public async Task <IActionResult> VolunteersBlueShirt([FromQuery] DateModel model) { var user = await userManager.GetUserAsync(User); if (user == null || !(await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.Staff.ToString()))) { return(Utilities.ErrorJson("Not authorized.")); } if (model.Date == DateTime.MinValue) { return(Utilities.GenerateMissingInputMessage("date")); } try { AnalyticsRepository repo = new AnalyticsRepository(configModel.ConnectionString); return(new JsonResult(new { Count = repo.GetNumBlueShirtVolunteers(model) })); } catch (Exception exc) { return(new JsonResult(new { Error = exc.Message, })); } }