3

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.

2 Answers 2

5

We have released a hotfix for the StoreGeneratedPattern issue. Try it out!

MSConnect: http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=37957

Code Gallery: http://archive.msdn.microsoft.com/KB2561001

0
3

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.

2
  • 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: huagati.blogspot.com/2010/08/…
    – KristoferA
    Aug 25, 2010 at 3:34
  • we are starting a new MVC 4 project using VS2012, EF 5 and ODP.NET for Oracle 11 and we are experiencing exactly the same problem. Everytime we "generate database from model", the ssdl part on edmx file loses the "storedGeneratedPatter=Identity" attribute. Are you planning an hotfix for VS2012 and EF 5 supporting Oracle too?
    – as-cii
    Dec 11, 2012 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.