コード例 #1
0
        public async Task <string> GetLeaguesForUser()
        {
            // Obtain UserID.
            var userID = Int32.Parse(HttpContext.User.FindFirst(ClaimTypes.Name).Value);

            // Returns a list of League Objects.
            var leagues = await _leagueService.GetLeaguesForUser(userID);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(leagues));
        }
コード例 #2
0
 public JsonResult GetLeaguesForUser(int UserID)
 {
     return(Json(LeagueService.GetLeaguesForUser(UserID), JsonRequestBehavior.AllowGet));
 }