Added authentication and authorization, updated dependency injections, removed hard-coded connection string
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| using ApplicationLayer.Applicants.NeededServices; | ||||
| using ApplicationLayer.DataAccessingServices.Applicants.NeededServices; | ||||
| using Domains.ApplicantDomain; | ||||
| using Infrastructure.Database.Generic; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| using ApplicationLayer.Locations.NeededServices; | ||||
| using ApplicationLayer.DataAccessingServices.Locations.NeededServices; | ||||
| using Domains.LocationDomain; | ||||
| using Infrastructure.Database.Generic; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| using ApplicationLayer.Locations.NeededServices; | ||||
| using ApplicationLayer.DataAccessingServices.Locations.NeededServices; | ||||
| using Domains.LocationDomain; | ||||
| using Infrastructure.Database.Generic; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
|   | ||||
| @@ -0,0 +1,22 @@ | ||||
| using Domains.Users; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Users.Configuration | ||||
| { | ||||
|     public class UserConfiguration : IEntityTypeConfiguration<User> | ||||
|     { | ||||
|         public void Configure(EntityTypeBuilder<User> entity) | ||||
|         { | ||||
|             entity.Property(u => u.Email) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(254); | ||||
|  | ||||
|             entity.HasIndex(u => u.Email).IsUnique(); | ||||
|  | ||||
|             entity.Property(u => u.Password) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(50); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| using ApplicationLayer.VisaApplications.NeededServices; | ||||
| using ApplicationLayer.DataAccessingServices.VisaApplications.NeededServices; | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Infrastructure.Database.Generic; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user