// GET: Gets all teams public IActionResult GetTeams() { // Create a new list List <Team> result = new List <Team>(); try { // Respond with a 200 - success. Return the list with all the teams result = manager.GetTeams().ToList(); ResponseData <List <Team> > response = new ResponseData <List <Team> >(); response.Content = result; response.Code = 200; response.HasBeenSuccessful = true; var httpResult = this.Ok(response); return(httpResult); } catch (Exception e) { // Respond with a 400, something went wrong Console.WriteLine(e.Message); ResponseData <List <Team> > response = new ResponseData <List <Team> >(); response.Content = null; response.Code = 400; response.HasBeenSuccessful = false; var httpResult = this.Ok(response); return(httpResult); } }
public async Task <IActionResult> Index() { var vm = new InsightDashboardVm(); vm.Teams = _teamManager.GetTeams(); vm.Users = await _userAccountManager.GetAllUsers(); vm.Issues = _issueManager.GetIssues(); return(View(vm)); }
public ActionResult Index() { try { var teamListVm = new TeamListVM { Teams = teamManager.GetTeams() }; return(View(teamListVm)); } catch (Exception ex) { log.Error("error loading teams for user " + UserID, ex); return(View("Error")); } }
private static void ListTeams(ITeamManager teamManager) { foreach (Team team in teamManager.GetTeams()) { Console.WriteLine("{0} is graded a {1}", team, team.Grade); } }
public IActionResult TeamsView() { List <TeamModel> TeamModels = teamManager.GetTeams(); return(View(TeamModels)); }
public async Task <IActionResult> GetTeams(int userId) { return(Ok(await _teamManager.GetTeams(userId))); }