Esempio n. 1
0
        public async Task <HeatingTypeForReturnDto> Delete(int Id)
        {
            var checkFromDb = await heatingTypeDal.GetAsync(x => x.Id == Id);

            if (checkFromDb == null)
            {
                throw new RestException(HttpStatusCode.BadRequest, new { NotFound = Messages.NotFound });
            }

            await heatingTypeDal.Delete(checkFromDb);

            var mapForReturn = mapper.Map <HeatingType, HeatingTypeForReturnDto>(checkFromDb);

            return(mapForReturn);
        }
Esempio n. 2
0
 public IResult Delete(HeatingType heatingType)
 {
     _heatingTypeDal.Delete(heatingType);
     return(new SuccessResult(Messages.HeatingTypeDeleted));
 }