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)); }
// 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)); }
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); }
public async Task <IList <CategoryDto> > GetCategoriesAsync() { return(await _categoryServices.Get()); }