예제 #1
0
        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));
        }
예제 #2
0
 public IResult Update(HeatingType heatingType)
 {
     _heatingTypeDal.Update(heatingType);
     return(new SuccessResult(Messages.HeatingTypeUpdated));
 }