问题
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...
回答1:
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.
来源:https://stackoverflow.com/questions/11843264/purpose-of-edmgen-validation-comparing-ssdl-and-database-schemas