public async Task <HeatingTypeForReturnDto> Update(HeatingTypeForCreationDto updateDto) { var checkById = await heatingTypeDal.GetAsync(x => x.Id == updateDto.Id); if (checkById == null) { throw new RestException(HttpStatusCode.BadRequest, new { NotFound = Messages.NotFound }); } var mapForUpdate = mapper.Map(updateDto, checkById); await heatingTypeDal.Update(mapForUpdate); return(mapper.Map <HeatingType, HeatingTypeForReturnDto>(mapForUpdate)); }
public IResult Update(HeatingType heatingType) { _heatingTypeDal.Update(heatingType); return(new SuccessResult(Messages.HeatingTypeUpdated)); }