Hello! I have a Person class being generated by LINQ to SQL, which has a Rota association property to a Rota class.
However when trying to access the Rota property on Person (for instance calling db.People.First().Rota
), a NullReferenceException in thrown in the generated LINQ to SQL class's property: get
{
return this._Rota.Entity;
}
The _Rota field is being set to default(EntityRef<Rota>)
in the constructor for Person.
When I hover over the Person instance in Visual Studio, the DataTip shows the Rota property as existing and being properly populated. I can't work out why it isn't being initalized in the code.
I've tried regenerating the generated code, and other associations are working fine.
Thanks in advance