예제 #1
0
        public async Task <bool> Delete(int id)
        {
            var animalType = await Get(id);

            _context.Remove(animalType);
            _logger.Warning("AnimalType {name} deleted, Id: {id}", animalType.Name, animalType.Id);
            return(await _context.SaveChangesAsync() > 0);
        }
예제 #2
0
        public async Task <bool> Delete(int id)
        {
            var category = await Get(id);

            _context.Remove(category);
            _logger.Warning("Category {category} with name {name} deleted, Id: {id}",
                            typeof(T).Name, category.Name, category.Id);
            return(await _context.SaveChangesAsync() > 0);
        }