1

Not sure what the EDMGEN is validating here

It validates the ssdl file against a live database schema looking for inconsistencies)?

Ot it only validates the internal consistency between the ssdl, csdl and msl files?

If nobody has changed manually the contents of the autogenerated ssdl, csdl and msl files is there any reason to validate them?

Is this validation the same that runs when "Validate On Build" property of the ConceptualEntityModel is set to true in visual studio?

Is there any way to check consistency between ssdl file and live database? (like new tables, diferents fields, foreign keys, etc...) A similar results like the ones provided by Redgate SQLCompare when comparing schemas...

Eduard
  • 664
  • 2
  • 14
  • 26

1 Answers1

2

Ot it only validates the internal consistency between the ssdl, csdl and msl files?

It validates only EDMX file - it means consistency between SSDL, MSL and CSDL.

Is this validation the same that runs when "Validate On Build" property of the ConceptualEntityModel is set to true in visual studio?

Yes

Is there any way to check consistency between ssdl file and live database?

That is not purpose of EDMGEN validation or entity framework. If you have VS Premium or Ultimate edition you can use its database tools to compare two databases - that is mostly equivalent to RedGate's SQL Compare. I'm not sure if there is any tool to compare SSDL and the real database but what you usually only need is set of your integration tests which will validate that your database still works with your model.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • Anyway testing the consistency between the SSDL file generated in design time from my local workstation connected to a local database vs the database in which the application is deployed would be a very nice to have. In other scenarios too, like a database recovery scenario or maybe after another team have changed the database (adding new tables or adding columns)... or after let's say 3 years, just check that the deployed code is still consistent with the database... – Eduard Aug 07 '12 at 10:56
  • Additionally visual studio have the option "Update model from database". In particular I'm very interested in the "Refresh" and "Delete" tabs there... Is there anyway to have this results in code? – Eduard Aug 07 '12 at 10:58
  • If you have local database you can compare it with remote database directly with mentioned tools. Anyway you can propose it as a suggestion on [Data UserVoice](http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions). You can also ask if this part of code is available in [EF open source project](http://entityframework.codeplex.com/). – Ladislav Mrnka Aug 07 '12 at 10:59