All,
I'm starting out with Entity Framework 4 (not CTP5 yet) and am looking at the complexities of migrating NHibernate to EF.
Some code we have tests if a collection or related entity is a proxy and, if so, performs some different code to normal. If the collection is not a proxy (i.e. it has already been loaded into the context) then we do something else directly against the collection.
I've migrated this code to use the IRelatedEnd interface for collections, but the act of casting my ICollection to IRelatedEnd causes EF to load the collection... the result is that the collection is never a proxy when I check for IsLoaded == true in the next line.
Do I need to do something extra considering this is a custom POCO or is this expected behaviour?
Likewise, is there anyway to test if a related entity is a proxy or not?
Many thanks