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); }
public IResult Delete(HeatingType heatingType) { _heatingTypeDal.Delete(heatingType); return(new SuccessResult(Messages.HeatingTypeDeleted)); }