Code First - Two References to Same Table (ICollection & Regular) RRS feed

  • Question

  • User-826606388 posted

    Hi All,

    I have users & departments as ICollections of each other.  Everything works great.

    Within the Identity Model I want to add a second link to department as a primary department.

    Basically User1 can be a part of dep1, dep2, dep3 - but when they login they will see dep2 (their primary department) first.

    I tried the following code but it ignores the first ICollection and only does the regular

    public virtual ICollection<Dept> Dept{ get; set; }
    public virtual Dept PrimaryDept { get; set; }

    Wednesday, August 26, 2015 9:36 PM

All replies