First, to understand your problem, what you need to know is that the EDMX file is just an XML file that contains 3 different sections:
CSDL
: Conceptual schema definition languageSSDL
: Store schema definition languageMSL
: Mapping specification language
The CSDL
contains the entities and relationships that make up your conceptual model. The SSDL
describes your DB model and the MSL
is the mapping between the 2.
The “Update Model From DB” process will update the SSDL
(change everything that is inconsistent with the current DB schema), it will only modify the CSDL
in case you’ve added new things to your DB schema.
This is quite a normal behavior since your Conceptual schema may/should differ from your DB schema (unless you want your Domain model to look exactly like a DB model which obviously do not sound as OOP/DDD best practices).
The Function Import mechanism works the same way. As soon as you import a new Stored Procedure, a new FunctionImport
Element will be added in the CSDL
. This new element will describe the SP including its parameters. As I said, only new things will be added in the CSDL
if you run the Update Wizard, that's why if you change any SP parameter in your DB, it won't be changed in the conceptual model.
To force the conceptual model to change, open your EDMX, go in your Model Browser, expand the Function Import entry:
- If you want everything to be refreshed, simply remove the function and import it again
- If you want to change input parameters, expand the right function, remove the parameters and update the function
- If you want to update only the return type, right click on the right function, select update and click on Update