I have a real entity Division under database model (EF 4.0).
Also I have to use this class to represent a self-referencing table
public class DivisionHierarchy
{
public Division Division { get; set; }
public IEnumerable<DivisionHierarchy> Divisions { get; set; }
}
How I can “convert” DivisionHierarchy into Entity?
Thank you!
You will need to create a DivisionHierarchy Entity which has one to many relationship to Division (1 Division to many DivHierarchy) and also has a one to many relationship to itself.
This will generate code which allows you to do this: