public async Task DeleteAsync(long id) { var productToDelete = await productRepository.ReadAsync(id); if (productToDelete != null) { await productRepository.DeleteAsync(productToDelete); } }
public virtual async Task <TDto> DeleteAsync(TID id, Action <string, string> AddErrorMessage) { if (!await _repository.AnyAsync(e => e.Equals(id))) { throw new EntityNotFoundException <TEntity, TID>(id); } TEntity deletedEntity = await _repository.DeleteAsync(id); if (deletedEntity != null) { await _context.SaveChangesAsync(); } return(_mappingService.EntityToDto(deletedEntity)); }
public async Task <IActionResult> DeleteMinisterialEffect(int id) { await _crudRepository.DeleteAsync <MinisterialEffect>(id); return(Ok()); }
public async Task <IActionResult> Delete(int id) { await _crudRepository.DeleteAsync <SubjectCard>(id); return(Ok()); }
public async Task <IActionResult> DeleteStudyProgram(int id) { await _crudRepository.DeleteAsync <StudyProgram>(id); return(Ok()); }