I currently have a table of series. In this table, a field status_id exists, which is the foreign key linking to a table Status. A status can be new, running, ended,...
My model classes are looking like this:
public partial class Serie
{
public Serie()
{
this.Episodes = new HashSet<Episode>();
}
public int ID { get; set; }
public string Name { get; set; }
public string Country { get; set; }
public Nullable<int> Status_id { get; set; }
public virtual ICollection<Episode> Episodes { get; set; }
public virtual Status Status { get; set; }
}
Status:
public partial class Status
{
public Status()
{
this.Series = new HashSet<Serie>();
}
public int ID { get; set; }
public string Name { get; set; }
public virtual ICollection<Serie> Series { get; set; }
}
When editinga serie, I'd like to have a dropdown list of all possible statuses (the name field) and receive this when a user submits the form. What's the best way to accomplish this?