Initial NavigationProperty Collections to empty collection
Posted: Thu 11 Dec 2014 09:54
We try to Switch from the EF Provider developed by Oracle to dotconnect for Oracle 8.4 to use it in EntityFramework.
After solving several issues during Migration I see a difference in the generated Code of the C# classes that is annoying.
Navigation Properties of 1-to-many-associations are of Type Collection<MyEntity>, which is fine, but in contrast to Oracles Provider dotConnect seems not to initialize those to an empty collection.
As a result the property returns null and therefore it is not possible to query it without checking for null.
Is it possible to configure the DbContext Code Generator to somehow add an initialization to Collection properties that creates an empty Collection?
regards
Peter
After solving several issues during Migration I see a difference in the generated Code of the C# classes that is annoying.
Navigation Properties of 1-to-many-associations are of Type Collection<MyEntity>, which is fine, but in contrast to Oracles Provider dotConnect seems not to initialize those to an empty collection.
As a result the property returns null and therefore it is not possible to query it without checking for null.
Is it possible to configure the DbContext Code Generator to somehow add an initialization to Collection properties that creates an empty Collection?
regards
Peter