Im curious when using Identity and saving the user info inside aspnetUsers table in the Default EF framework database. Is there a way to render the properties to a view that can be viewed by other Users that are all on at the same time when the app is running. Im having an issue where Im just getting the current user. I need to build a user search sub system that can display users and have a link to their profiles.
For example I added properties to my ApplicationUser in Identity.Models
public` string displayName { get; set; }
public string age { get; set; }
public string description { get; set; }
in my Home controller(I know its in about but im just testing to see if it works)
public ActionResult About() {
// Instantiate the ASP.NET Identity system
var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
var currentUser = manager.FindById(User.Identity.GetUserId());
// Recover the profile information about the logged in user
ViewBag.displayName = currentUser.displayName;
ViewBag.age = currentUser.age;
ViewBag.description = currentUser.description;
////////
var usr = User.Identity.Name;
// var usrName = ;
ViewBag.Message = usr;
return View();
}
In my About view
@using Microsoft.AspNet.Identity;
@{
ViewBag.Title = "About";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<h3>@ViewBag.displayName</h3>
<h3>@ViewBag.age</h3>
<h3>@ViewBag.description</h3>
I can see the current user properties but im trying to figure out How asp.net interacts with other Application users to view other profiles? I know the program is doing what im asking it to do(placing the properties from the current user in the about view) but I kind of have no Idea of where to go next.