I'm creating a forum and I have recently implemented Simple Membership. What I'm trying to do now is display the actual name of who wrote the post. As of now I'm only able to display the UserId of the user.
I have two models: The Simplemembership model AccountModels, and my ForumModels. My Forummodel Posts contains a field for UserId.
I've tried adding some of the tables from AccountModels to my ForumModels, but this just caused an error (Since I was trying to create the same table twice)
I've tried creating a ViewModel that contained Posts and UserProfile, but couldn't populate it correctly with data.
Lastly I tried performing a join on the two tables Post and Userprofile
var posts = (from p in db.Posts
join u in udb.UserProfiles
on p.UserId equals u.UserId
where p.TopicId == id
select p);
return View(posts);
This created the error:
The specified LINQ expression contains references to queries that are associated with different contexts.
Any ideas on what I should do?