From 7805d69917b05a1af999fa7789d7dbeba3f2167a Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 18 May 2017 19:59:47 -0400 Subject: [PATCH] hopefully fix /Manage/SetAvatar --- Project-Unite/Controllers/ManageController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs index d80cbcb..7a43166 100644 --- a/Project-Unite/Controllers/ManageController.cs +++ b/Project-Unite/Controllers/ManageController.cs @@ -23,7 +23,8 @@ public ManageController() public ActionResult SetAvatar(string id) { var db = new ApplicationDbContext(); - var usr = db.Users.FirstOrDefault(x => x.Id == User.Identity.GetUserId()); + string uid = User.Identity.GetUserId(); + var usr = db.Users.FirstOrDefault(x => x.Id == uid); var avtr = db.UserAvatars.FirstOrDefault(x => x.Id == id); usr.AvatarUrl = avtr.AvatarUrl; db.SaveChanges();