I would like to know if there is a possibility to check my edmx in the code. In fact what i want to check is if there are differences between the base and the edmx file that could make my code crash in order to say to users (or the team support) that the base must be updated for exemple.
Thak you :)
EDMX is a text-based format, it uses XML on the inside. So you can use a diff.
You will see the differences pretty quickly. The XML is also easy to read, so you can know where exactly the problem lies.
If you want to automatically check it at runtime, you can still use this method, as long as the customer's app contains an EDMX file fitting their database version (just package it when you are delivering the appliaction). Then use a library to do the diff.
Update I am not sure that you can generate an EDMX file at runtime, but if there is a solution, it probably involves the EdmxWriter class. If this does not work, and you absolutely have to do the check at runtime (e.g. your customers have the access to modify the schema of the DB you delivered), you are probably better off comparing database schemas instead of EDMX files. But for most cases, the simple solution is to include some metainformation about the database version somewhere where it won't change (e.g. a version number in the database itself) and then check this.