public static Domain.Sale MapFromDAL(DAL.App.DTO.DomainLikeDTO.Sale sale) { var res = sale == null ? null : new Domain.Sale { Id = sale.Id, Description = new MultiLangString(sale.Description), AppUserId = sale.AppUserId, AppUser = AppUserMapper.MapFromDAL(sale.AppUser), SaleInitialCreationTime = sale.SaleInitialCreationTime, }; return(res); }
public override Sale Update(Sale entity) { var entityInDb = RepositoryDbSet .Include(a => a.Description).ThenInclude(t => t.Translations) .FirstOrDefault(x => x.Id == entity.Id); if (entityInDb == null) { return(entity); } entityInDb.AppUserId = entity.AppUserId; entityInDb.SaleInitialCreationTime = entity.SaleInitialCreationTime; RepositoryDbSet.Update(entityInDb); entityInDb.Description.SetTranslation(entity.Description); return(entity); }