Removed location entities, fixed configurations and controllers' comments

This commit is contained in:
2024-08-21 18:39:22 +03:00
parent f857ba90f8
commit 3e21a0a164
47 changed files with 111 additions and 506 deletions

View File

@@ -1,6 +1,5 @@
using Domains;
using Domains.ApplicantDomain;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Infrastructure.Database.Applicants.Configuration;
@@ -9,15 +8,20 @@ public static class AddressConfiguration<T> where T : class, IEntity
{
public static void Configure(OwnedNavigationBuilder<T, Address> entity)
{
entity.HasOne(a => a.Country).WithMany().OnDelete(DeleteBehavior.Restrict);
entity.HasOne(a => a.City).WithMany().OnDelete(DeleteBehavior.Restrict);
entity.Property(p => p.Street)
entity.Property(a => a.Country)
.IsUnicode(false)
.HasMaxLength(100);
.HasMaxLength(ConfigurationConstraints.CountryNameLength);
entity.Property(p => p.Building)
entity.Property(a => a.City)
.IsUnicode(false)
.HasMaxLength(10);
.HasMaxLength(ConfigurationConstraints.CityNameLength);
entity.Property(a => a.Street)
.IsUnicode(false)
.HasMaxLength(ConfigurationConstraints.StreetNameLength);
entity.Property(a => a.Building)
.IsUnicode(false)
.HasMaxLength(ConfigurationConstraints.BuildingNumberLength);
}
}