Пример #1
0
        public Results.GenericResult Delete(int id)
        {
            var result = new Results.GenericResult();

            try
            {
                result.Success = appService.Delete(id);
                if (!result.Success)
                {
                    throw new Exception($"Todo {id} can't be deleted");
                }
            }
            catch (Exception ex)
            {
                result.Errors = new string[] { ex.Message };
            }

            return(result);
        }
Пример #2
0
 public bool Delete(int id)
 {
     return(_appService.Delete(id));
 }