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());
        }
 public Task <IEnumerable <TObject> > FindBySpecificationAsync <TObject>(Expression <Func <TObject, bool> > expr) where TObject : IEntity
 {
     return(_wrappedDao.FindBySpecificationAsync(expr));
 }
Exemple #3
0
        public async Task <IActionResult> CheckJobRunnerUsageAsync(Guid jobRunnerId)
        {
            var projects = await _dao.FindBySpecificationAsync <Project>(x => x.JobRunnerId == jobRunnerId);

            return(Ok(projects.Select(p => p.Id).ToArray()));
        }