public static Domain.Defect MapFromDAL(DAL.App.DTO.DomainLikeDTO.Defect defectWithProductCount) { var res = defectWithProductCount == null ? null : new Domain.Defect { Id = defectWithProductCount.Id, Description = new MultiLangString(defectWithProductCount.Description), ShopId = defectWithProductCount.ShopId, Shop = ShopMapper.MapFromDAL(defectWithProductCount.Shop) }; return(res); }
public static externalDTO.Defect MapFromDAL(internalDTO.Defect defect) { var res = defect == null ? null : new externalDTO.Defect { Id = defect.Id, Description = defect.Description, ShopId = defect.ShopId, Shop = ShopMapper.MapFromDAL(defect.Shop) }; if (defect?.ProductsWithDefect != null) { res.ProductsWithDefect = defect.ProductsWithDefect.Select(e => ProductWithDefectMapper.MapFromDAL(e)).ToList(); } return(res); }