コード例 #1
0
 public Ad(Infrastructure.Entities.Ad infrastructureAd, IEnumerable <Infrastructure.Entities.Picture> infrastructurePictures)
 {
     Id          = infrastructureAd.Id;
     Description = infrastructureAd.Description;
     GardenSize  = infrastructureAd.GardenSize;
     HouseSize   = infrastructureAd.HouseSize;
     if (Enum.TryParse(infrastructureAd.Typology, out Typology typology))
     {
         Typology = typology;
     }
     Pictures = GetPicturesByInfrastructurePictures(GetInfrastructurePictures(infrastructureAd, infrastructurePictures));
 }
コード例 #2
0
 private static IEnumerable <Infrastructure.Entities.Picture> GetInfrastructurePictures(Infrastructure.Entities.Ad infrastructureAd, IEnumerable <Infrastructure.Entities.Picture> infrastructurePictures)
 {
     return(infrastructurePictures.Where(x => infrastructureAd.Pictures.Contains(x.Id)));
 }