I'm having a difficult time trying to map out my relationships with EF code first. We're creating a "Lookup" table for key value pairs. This table also has a type to define the type of lookup. These will be used in a number of dropdown lists in the app. The table will basically have Id, Name, Type. Some of the larger entities may have multiple lookup values. Below is an example. There is also a many to many relationship that needs to 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 this even possible to accomplish?