In the sample code for the CSLA 3.8 core video series, in the Core380\Data\ObjectFactory\Library\TestObject.cs file, you add a PropertyInfo for the EF EntityKey, which, if I understand correctly, is useful in preventing a round-trip to the DB during updates.
My question is, why do you set that PropertyInfo to type "byte", which forces you to Serialize/Deserialize it, instead of just using System.Data.EntityKey ?
If I use the EntityKey type, then all my code needs to reference EF, even client-side libraries and things that shouldn't have to have such a reference.
That couples my entire app to EF, which is (imo) a bad thing. I want only my DAL to be coupled to EF.
Additionally, it might be that EntityKey isn't serializable? I don't know for sure.
I am reasonably certain it won't serialize to Silverlight, where EF doesn't exist at all.
And that's probably the key - most of my work for a long time now has been Silverlight focused - so things that don't work or exist on Silverlight must be isolated very carefully so they are only used in very controlled parts of the code.
Makes tons of sense
Copyright (c) Marimer LLC