foreign keys - Entity Framework - multiple relationships to lookup table -


i'm having difficult time trying map out relationships ef code first. we're creating "lookup" table key value pairs. table has type define type of lookup. these used in number of dropdown lists in app. table have id, name, type. of larger entities may have multiple lookup values. below example. there many many relationship needs exist.

public partial class systemdetail : entitydata {     public string brandid { get; set; }     [foreignkey("brandid")]     public lookup brand { get; set; }      public string operatingsystemid { get; set; }     [foreignkey("operatingsystemid")]     public lookup operatingsystem { get; set; }      public string batterytypeid { get; set; }     [foreignkey("batterytypeid")]     public lookup batterytype { get; set; }      public icollection<lookup> removablestoragedevices { get; set; } }  public class lookup : entitydata {     [maxlength(125)]     public string name { get; set; }     public lookuptypeenum lookuptype { get; set; }      public icollection<systemdetail> systemdetails { get; set; } } 

is possible accomplish?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -