public async Task <ApiResponse <bool> > DeleteAppTemplateConversionUnit(AppTemplateConversionUnitDeleteDto dto) { bool resultDto = true; Metadata metadata = new Metadata { IsValid = true, Message = "" }; ApiResponse <bool> response = new ApiResponse <bool>(resultDto); try { AppTemplateConversionUnit appTemplateConversionUnit = await GetById(dto.Id); if (appTemplateConversionUnit == null) { metadata.IsValid = false; metadata.Message = "Template No existe!!!"; response.Meta = metadata; response.Data = resultDto; return(response); } resultDto = await Delete(dto.Id); metadata.IsValid = true; metadata.Message = $"Template Eliminado Satisfactoriamente!"; response.Meta = metadata; response.Data = resultDto; return(response); } catch (Exception ex) { metadata.IsValid = false; metadata.Message = ex.InnerException.Message; response.Meta = metadata; response.Data = resultDto; return(response); } }
public async Task <IActionResult> DeleteTemplateConversionUnit(AppTemplateConversionUnitDeleteDto dto) { var response = await _appTemplateConversionUnitService.DeleteAppTemplateConversionUnit(dto); return(Ok(response)); }