public static Domain.Return MapFromDAL(DAL.App.DTO.DomainLikeDTO.Return returnWithProductCount) { var res = returnWithProductCount == null ? null : new Domain.Return { Id = returnWithProductCount.Id, Description = new MultiLangString(returnWithProductCount.Description), ShopId = returnWithProductCount.ShopId, Shop = ShopMapper.MapFromDAL(returnWithProductCount.Shop) }; return(res); }
public override Return Update(Return entity) { var entityInDb = RepositoryDbSet .Include(a => a.Description).ThenInclude(t => t.Translations) .FirstOrDefault(x => x.Id == entity.Id); if (entityInDb == null) { return(entity); } entityInDb.ShopId = entity.ShopId; RepositoryDbSet.Update(entityInDb); entityInDb.Description.SetTranslation(entity.Description); return(entity); }