public async Task <StoreCategoryDetailDto> DeleteById(Guid Id)
        {
            var modelToDelete = await _storeCategoryRepository.FindByCondition(x => x.Id == Id);

            if (!modelToDelete.Any())
            {
                throw new ApiException("No se pudo Eliminar la categoria ", HttpStatusCode.NotFound);
            }
            _storeCategoryRepository.Delete(modelToDelete.FirstOrDefault());
            return(_mapper.Map <StoreCategoryDetailDto>(modelToDelete.FirstOrDefault()));
        }
Exemplo n.º 2
0
 public async Task DeleteAsync(StoreCategory category)
 {
     _repository.Delete(category);
     await _repository.SaveChangesAsync();
 }