Пример #1
0
        public async Task <IActionResult> DeleteByNameAsync(string name)
        {
            var customers = await dao.FindBySpecificationAsync <Model.Customer>(p => p.Name == name);

            if (customers?.Count() == 0)
            {
                return(NotFound());
            }

            await dao.DeleteByIdAsync <Model.Customer>(customers.First().Id);

            return(NoContent());
        }
Пример #2
0
        public async Task <IActionResult> DeleteProjectByIdAsync(Guid id)
        {
            var project = await _dao.GetByIdAsync <Project>(id);

            if (project == null)
            {
                return(NotFound($"The project {id} doesn't exist."));
            }

            await _dao.DeleteByIdAsync <Project>(id);

            return(Ok());
        }
        public async Task DeleteByIdAsync <TObject>(Guid id) where TObject : IEntity
        {
            await _wrappedDao.DeleteByIdAsync <TObject>(id);

            await _cache.RemoveAsync(id.ToString());
        }