From 02e8a1186188903c6b5b5a44dace3f62abfe3746 Mon Sep 17 00:00:00 2001 From: "michael.jolin" Date: Mon, 9 Jul 2018 16:28:07 -0400 Subject: [PATCH] feat(#163): Add id_city to building --- Survi.Prevention.DataLayer/Mapping/BuildingMapping.cs | 3 ++- Survi.Prevention.Models/Buildings/Building.cs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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; }