Changed domains, configured links between VisaApplication and Applicant,created generic repository and repositories for domains
This commit is contained in:
		| @@ -0,0 +1,16 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.VisaApplications.Configuration | ||||
| { | ||||
|     public class PastVisaConfiguration : IEntityTypeConfiguration<PastVisa> | ||||
|     { | ||||
|         public void Configure(EntityTypeBuilder<PastVisa> entity) | ||||
|         { | ||||
|             entity.Property(p => p.Name) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(70); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,16 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.VisaApplications.Configuration | ||||
| { | ||||
|     public class PermissionToDestCountryConfiguration : IEntityTypeConfiguration<PermissionToDestCountry> | ||||
|     { | ||||
|         public void Configure(EntityTypeBuilder<PermissionToDestCountry> entity) | ||||
|         { | ||||
|             entity.Property(p => p.Issuer) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(200); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,16 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.VisaApplications.Configuration | ||||
| { | ||||
|     public class ReentryPermitConfiguration : IEntityTypeConfiguration<ReentryPermit> | ||||
|     { | ||||
|         public void Configure(EntityTypeBuilder<ReentryPermit> entity) | ||||
|         { | ||||
|             entity.Property(p => p.Number) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(25); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,22 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.VisaApplications.Configuration | ||||
| { | ||||
|     public class VisaApplicationConfiguration : IEntityTypeConfiguration<VisaApplication> | ||||
|     { | ||||
|         public void Configure(EntityTypeBuilder<VisaApplication> entity) | ||||
|         { | ||||
|             entity.ToTable("VisaApplications"); | ||||
|  | ||||
|             entity.HasOne(va => va.Applicant) | ||||
|                 .WithMany(a => a.VisaApplications) | ||||
|                 .HasForeignKey(va => va.ApplicantId) | ||||
|                 .IsRequired(); | ||||
|  | ||||
|             entity.OwnsOne(p => p.ReentryPermit); | ||||
|             entity.OwnsOne(p => p.PermissionToDestCountry); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user