Lets say I have an entity Foo, and it contains a list of another entity Bar. Should Bar have a direct reference to Foo? i.e...
public class Foo
{
public int Id {get; set;}
public IList<Bar> Bars {get; set;}
}
public class Bar
{
public int Id {get; set;}
public Foo parentFoo {get; set; //this will be set to an the Foo entity on creation
}
or do I just leave out the reference to Foo in my Bar class?
I am leaning toward leaving that reference out, but was wondering what the correct approach is here?