Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @@ -0,0 +1,27 @@ | ||||
| using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Applicants.Configuration; | ||||
|  | ||||
| public static class AddressConfiguration<T> where T : class, IEntity | ||||
| { | ||||
|     public static void Configure(OwnedNavigationBuilder<T, Address> entity) | ||||
|     { | ||||
|         entity.Property(a => a.Country) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CountryNameLength); | ||||
|  | ||||
|         entity.Property(a => a.City) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CityNameLength); | ||||
|  | ||||
|         entity.Property(a => a.Street) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.StreetNameLength); | ||||
|  | ||||
|         entity.Property(a => a.Building) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.BuildingNumberLength); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,40 @@ | ||||
| using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using Domains.Users; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Applicants.Configuration; | ||||
|  | ||||
| public class ApplicantConfiguration : IEntityTypeConfiguration<Applicant> | ||||
| { | ||||
|     public void Configure(EntityTypeBuilder<Applicant> entity) | ||||
|     { | ||||
|         entity.OwnsOne(a => a.Name, NameConfiguration<Applicant>.Configure); | ||||
|         entity.OwnsOne(a => a.FatherName, NameConfiguration<Applicant>.Configure); | ||||
|         entity.OwnsOne(a => a.MotherName, NameConfiguration<Applicant>.Configure); | ||||
|         entity.OwnsOne(a => a.Passport, PassportConfiguration<Applicant>.Configure); | ||||
|  | ||||
|         entity.HasOne<User>().WithOne().HasForeignKey<Applicant>(a => a.UserId); | ||||
|  | ||||
|         entity.Property(a => a.Citizenship) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CitizenshipLength); | ||||
|  | ||||
|         entity.Property(a => a.CitizenshipByBirth) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CitizenshipLength); | ||||
|  | ||||
|         entity.Property(a => a.CountryOfBirth) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CountryNameLength); | ||||
|  | ||||
|         entity.Property(a => a.CityOfBirth) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CityNameLength); | ||||
|  | ||||
|         entity.Property(a => a.JobTitle) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.JobTitleLength); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,23 @@ | ||||
| using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Applicants.Configuration; | ||||
|  | ||||
| public static class NameConfiguration<T> where T : class, IEntity | ||||
| { | ||||
|     public static void Configure(OwnedNavigationBuilder<T, Name> entity) | ||||
|     { | ||||
|         entity.Property(p => p.FirstName) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.NameLength); | ||||
|  | ||||
|         entity.Property(p => p.Surname) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.NameLength); | ||||
|  | ||||
|         entity.Property(p => p.Patronymic) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.NameLength); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,19 @@ | ||||
| using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Applicants.Configuration; | ||||
|  | ||||
| public static class PassportConfiguration<T> where T : class, IEntity | ||||
| { | ||||
|     public static void Configure(OwnedNavigationBuilder<T, Passport> entity) | ||||
|     { | ||||
|         entity.Property(p => p.Number) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.PassportNumberLength); | ||||
|  | ||||
|         entity.Property(p => p.Issuer) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.IssuerNameLength); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,22 @@ | ||||
| using Domains; | ||||
| using Domains.ApplicantDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.Applicants.Configuration; | ||||
|  | ||||
| public class PlaceOfWorkConfiguration : IEntityTypeConfiguration<PlaceOfWork> | ||||
| { | ||||
|     public void Configure(EntityTypeBuilder<PlaceOfWork> entity) | ||||
|     { | ||||
|         entity.OwnsOne(p => p.Address, AddressConfiguration<PlaceOfWork>.Configure); | ||||
|  | ||||
|         entity.Property(p => p.Name) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.PlaceOfWorkNameLength); | ||||
|  | ||||
|         entity.Property(p => p.PhoneNum) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.PhoneNumberLength); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user