public async Task <ActionResult> Get()
        {
            #region Start the watch
            var watch = new Stopwatch();
            watch.Start();
            #endregion

            var result = await _entityServices.Get();

            #region End the watch
            watch.Stop();
            result.Meta.TotalProcessingTime = watch.ElapsedMilliseconds;
            #endregion

            return(Ok(result));
        }
Example #2
0
        // GET: Users/Details/5
        public async Task <IActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var user = await _categoryServices.Get(id.Value);

            if (user == null)
            {
                return(NotFound());
            }

            return(PartialView(user));
        }
Example #3
0
        public async Task <CategoryDto> GetCategoryAsync(string id)
        {
            var result   = ValidateId(id);
            var category = await _categoryServices.Get(result);

            if (category is null)
            {
                throw new NullReferenceException("Category not found");
            }
            return(category);
        }
Example #4
0
 public async Task <IList <CategoryDto> > GetCategoriesAsync()
 {
     return(await _categoryServices.Get());
 }