So what happened?

When we changed the database and then updated the model, the wizard didn’t do what you probably expected it to do. (It certainly came as a surprise to me when I was learning the Entity Framework, but you’re probably smarter than I am.)

What the wizard did was update the SSDL to reflect the changes in the database and update the MSL so that nothing in the conceptual model was mapped to a nonexistent database fields, but it otherwise maintained the conceptual model as we’d designed it.

Right-click on a blank area of the primary design surface and choose Mapping Details from the context menu. By default, the Mapping Details window will appear  below the primary design surface. If you select the Recipe entity, you can see what’s happened:

Image

If you select the WeightByUnit entity, you’ll see that the Mapping Details window is completely empty. None of the properties of this entity are mapped to the database any longer:

Image

Image My Opinion

The wizard does what it does, and there’s not much to be done about that. You can choose not to use it, of course, if you really don’t like the way it behaves.

But before you throw your hands up in disgust and decide that the Entity Framework team made a terrible decision, consider this: There is no way (or at least no practical way) for the wizard to know which of the changes you’ve made to the conceptual model you want to keep. It makes the changes it can—to the schema definition and the mapping layer—and leaves the decisions it can’t make to the person who can (you). Personally, I’d much rather fiddle around in the Mapping Details Window for a minute or two than spend hours manually updating the EDMX.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset