コード例 #1
0
 public JsonResult AssistReturn(AssistManager.AssistDto response)
 {
     return(new JsonResult()
     {
         Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
     });
 }
コード例 #2
0
        public async Task <JsonResult> Get(int collegeId, int yearId, bool updateRequest)
        {
            var usersRequestedCollege = db.Colleges.Find(collegeId);
            var usersRequestedYear    = db.Years.Find(yearId);

            AssistManager.AssistDto dto = new AssistManager.AssistDto();
            try
            {
                dto = await assistMan.GetAndUpdate(db, usersRequestedCollege, usersRequestedYear, updateRequest);
            }
            catch
            {
                // TODO If I keep iterating on this.. send me some kind of notification when we hit this
                dto.SetNotification("Server Error 😭 Please try again later", AssistManager.NotificationType.Error);
            }

            return(AssistReturn(dto));
        }