Im my project I have a class called Clubs and each club has a list of members which are apart of a different class called ClubMembers. I am wondering how I would create a edit view that would allow me to add and remove members to that list.
This is my Club Model:
public class Club
{
// Class to manage a single Club
[Key]
public int ClubID { get; set; }
//List of Members that are members of this Club
public virtual List<ClubMember> ClubMembers { get; set; }
}//end Club
This is my ClubMembers model:
public class ClubMember
{
[Key]
public int UserId { get; set; }
//Foreign Key for Club
public int ClubID { get; set; }
[ForeignKey("ClubID")]
public virtual Club Club { get; set; }
}//end User Class
To summarize what I would like is to be able to have an edit view that allows me to add and remove members and also change the details of the club.
Would this be possible on the same view as they are of different models?
If you would like to look at anymore of my code please ask.