I have two entities. Groups. Pools. A Group can create many pools.
So I setup my Pool table to have a GroupID foreign key.
My code:
using (entity _db = new entity()) {
Pool p = new Pool();
p.Name = "test";
p.Group.ID = "5";
_db.AddToPool(p);
}
This doesn't work. I get a null reference exception on p.Group.
How do I go about creating a new "Pool" and associating a GroupID?