public HttpResponseMessage GetWinner() { BlipUser user = BlipRepo.Current.GetWinner(); return(Request.CreateResponse(HttpStatusCode.OK, new { Winner = user })); }
public HttpResponseMessage Create(LoginModel model) { BlipUser user = new BlipUser { Avatar = model.Avatar, UserName = model.UserName, }; user = BlipRepo.Current.AddUser(user); return(Request.CreateResponse(HttpStatusCode.OK, user)); }
public HttpResponseMessage GetAll() { BlipUser user = GetUser(); List <UserFeed> feed = FeedRepo.Current.GetAll(); feed.Sort((x, y) => y.FeedId - x.FeedId); FeedViewModel model = new FeedViewModel { Feed = feed, Comment = "", User = user }; return(Request.CreateResponse(HttpStatusCode.OK, model)); }
private BlipUser GetUser() { BlipUser user = null; try { System.Console.WriteLine("Api Session ID: {0}", System.Web.HttpContext.Current.Session.SessionID); user = System.Web.HttpContext.Current.Session["CurrentUser"] as BlipUser; } catch (Exception e) { //TODO fix this user = new BlipUser { Avatar = "av1.PNG", UserId = 0, UserName = "******" }; } return(user); }