One to Many Model Declaration

From Logic Wiki
Revision as of 15:14, 5 April 2017 by AliIybar (Talk | contribs) (Created page with "<pre class="brush:csharp;"> public class Model { public int Id {get; set;} public string Name {get; set;} public Make Make {get; set;} public int MakeId {get; set;} }...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
public class Model
{
  public int Id {get; set;}
  public string Name {get; set;}
  public Make Make {get; set;}

  public int MakeId {get; set;}
}
public class Make
{
  public int Id {get; set;}
  public string Name {get; set;}
  public ICollection<Model> Models {get; set;}

  public Make()
  {
     Models = new Collection<Model>();
  }
}