Example #1
0
        public async Task DeleteAsync(long id)
        {
            var productToDelete = await productRepository.ReadAsync(id);

            if (productToDelete != null)
            {
                await productRepository.DeleteAsync(productToDelete);
            }
        }
Example #2
0
        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());
        }
Example #4
0
        public async Task <IActionResult> Delete(int id)
        {
            await _crudRepository.DeleteAsync <SubjectCard>(id);

            return(Ok());
        }
Example #5
0
        public async Task <IActionResult> DeleteStudyProgram(int id)
        {
            await _crudRepository.DeleteAsync <StudyProgram>(id);

            return(Ok());
        }