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();