If the storage model has the StoreGeneratedPattern=identity attribute set, why should not the conceptual model reflect this in some way? Either in and attribute or in a readonly nature of a property? If i need to pass a value to the reference field.
+3
A:
It should. And it does when it is working correctly. What you are probably seeing is a result of a bug in the designer.
When you set that property in the designer in VS2010 RTM, it only adds an annotation tag in the CSDL and does not add anything in the SSDL, so it doesn't treat it as read-only. Amazingly the same or very similar bug existed in EF 1.0!
If you edit the SSDL section by hand, it will work as advertised in the documentation. You just have to re-do, or merge your changes when you regenerate your model.
DanO
2010-07-21 21:51:04
If you want to avoid the xml-editing portion (and having to track down where the SSDL and CSDL differs), I have an add-in that adds a 'Model Comparer' for EFv4 models to VS2010. It shows differences such as store-gen, data type, nullability, maxlength/precision/scale, missing members, missing entities etc between the three layers (db, SSDL, CSDL), generates reports, and allow easy re-sync of individual differences or all differences.More info, and screencast-demos over at: http://huagati.blogspot.com/2010/08/using-model-comparer-to-generate.html
KristoferA - Huagati.com
2010-08-25 03:34:07