I am currently working on an event calendar website, and I'm still a newbie when it comes to ASP.NET. I am using the MVC4 Framework, as well as EntityFramework (CodeFirst) and SimpleMembershipProvider, which comes with the MVC4 template. I also use Migrations - if it's from any interest.
What i still have
Currently, I have two one-to-many models that work very well:
_Events.cs (should have called it that way since the event is reserved)
public class _Event { public int _EventId { get; set; } public string Name { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } public virtual List<Comment> comments { get; set; } }
Comment.cs
public class Comment { public int CommentId { get; set; } public string Text { get; set; } public int _EventId { get; set; } public virtual _Event _Event { get; set; } }
Problem
Now I would like to add another relationship between the comment and the user from the Membership model, but I canβt figure out how to do this.
The goal I would like to archive is that I can have a list of suggestions for each event and print out user information for each comment. I tried a few things but couldn't get it to work. My last attempt looks like this:
public class Comment {
I would like to thank you for any help in advance.
source share