コード例 #1
0
        // 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);
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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"));
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: hpinsley/SportsRank
 private static void ListTeams(ITeamManager teamManager)
 {
     foreach (Team team in teamManager.GetTeams()) {
         Console.WriteLine("{0} is graded a {1}", team, team.Grade);
     }
 }
コード例 #5
0
        public IActionResult TeamsView()
        {
            List <TeamModel> TeamModels = teamManager.GetTeams();

            return(View(TeamModels));
        }
コード例 #6
0
 public async Task <IActionResult> GetTeams(int userId)
 {
     return(Ok(await _teamManager.GetTeams(userId)));
 }