diff --git a/Survi.Prevention.DataLayer/Mapping/BuildingMapping.cs b/Survi.Prevention.DataLayer/Mapping/BuildingMapping.cs index e50769e5..08d3619f 100644 --- a/Survi.Prevention.DataLayer/Mapping/BuildingMapping.cs +++ b/Survi.Prevention.DataLayer/Mapping/BuildingMapping.cs @@ -29,7 +29,8 @@ public override void Map(EntityTypeBuilder b) b.HasOne(m => m.RiskLevel).WithMany().HasForeignKey(m => m.IdRiskLevel); b.HasOne(m => m.UtilisationCode).WithMany().HasForeignKey(m => m.IdUtilisationCode); b.HasOne(m => m.Lane).WithMany().HasForeignKey(m => m.IdLane); - b.HasOne(m => m.Transversal).WithMany().HasForeignKey(m => m.IdLaneTransversal); + b.HasOne(m => m.City).WithMany().HasForeignKey(m => m.IdCity); + b.HasOne(m => m.Transversal).WithMany().HasForeignKey(m => m.IdLaneTransversal); b.HasOne(m => m.Picture).WithMany().HasForeignKey(m => m.IdPicture); b.HasOne(m => m.Detail).WithOne(m => m.Building).HasForeignKey(m => m.IdBuilding); diff --git a/Survi.Prevention.Models/Buildings/Building.cs b/Survi.Prevention.Models/Buildings/Building.cs index 04818140..a477a49b 100644 --- a/Survi.Prevention.Models/Buildings/Building.cs +++ b/Survi.Prevention.Models/Buildings/Building.cs @@ -36,7 +36,8 @@ public class Building : BaseModel public string Details { get; set; } public BuildingChildType ChildType { get; set; } - public Guid IdLane { get; set; } + public Guid IdCity { get; set; } + public Guid IdLane { get; set; } public Guid? IdLaneTransversal { get; set; } public Guid? IdUtilisationCode { get; set; } public Guid IdRiskLevel { get; set; } @@ -45,7 +46,8 @@ public class Building : BaseModel public RiskLevel RiskLevel { get; set; } public UtilisationCode UtilisationCode { get; set; } - public Lane Lane { get; set; } + public City City { get; set; } + public Lane Lane { get; set; } public Lane Transversal { get; set; } public Building Parent { get; set; } public Picture Picture { get; set; }