I have a class called Locker that has the following property:
public virtual ICollection<LockerReserve> Reserves { get; set; }
The problem is that LockerReserve belongs to a context other than Locker. An exception is thrown whenever I try to retrieve a locker because it can not get the LockerReserve list.
public Locker GetLockerById(int lockerId)
{
var lockers = _lockerContext.Lockers
.Where(b => b.LockerId == lockerId);
return lockers.FirstOrDefault();
}
Can a class have a list of a type that is not in its context in the Entity Framework?