Added authentication and authorization, updated dependency injections, removed hard-coded connection string

This commit is contained in:
2024-08-17 16:28:35 +03:00
parent 026a104131
commit 7cbe3d9698
44 changed files with 419 additions and 49 deletions

View File

@@ -0,0 +1,17 @@
using ApplicationLayer.AuthServices.NeededServices;
using Domains.Users;
using Infrastructure.Database.Generic;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Database.Users.Repositories
{
/// <inheritdoc cref="IUsersRepository"/>
public class UsersRepository(IGenericReader reader, IGenericWriter writer, IUnitOfWork unitOfWork)
: GenericRepository<User>(reader, writer, unitOfWork), IUsersRepository
{
async Task<User?> IUsersRepository.FindByEmailAsync(string email, CancellationToken cancellationToken)
{
return await LoadDomain().SingleOrDefaultAsync(u => u.Email == email, cancellationToken);
}
}
}