How do you update the complex types associated with a stored procedure?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
strandedpirate
Posts: 21
Joined: Tue 07 Jan 2014 12:38

How do you update the complex types associated with a stored procedure?

Post by strandedpirate » Sat 01 Feb 2014 08:25

This is the scenario: I've imported a stored procedure and then created a method for it which automatically creates a complex type based on the columns it returns. Later I change the columns that the stored procedure returns. At this point I'd like to be able to have ED automatically update the complex type for me using a menu command, but I don't see that option if there is one.

So currently I go in and manually make the changes to the complex type, save, and regenerate the classes. However the application fails during run time because the .edml and the .msl "map" the renamed or newly added columns to the wrong column coming from the stored proc. The Entity Framework get its metadata from the .msl to make the magic happen but its not up to date.

Right now I close everything down and editing these two xml files manually and then rebuilding, but it would be better if there was a way to edit this mapping in the UI or auto-update through another workflow.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How do you update the complex types associated with a stored procedure?

Post by Shalex » Tue 04 Feb 2014 10:53

We recommend you to update the complex type associated with a particular method in the following way:
1) remove method with its complex type from conceptual part (CSDL) of the model via Model Explorer
2) drag&drop the stored procedure from storage part (SSDL) on the diagram surface of the model, this will recreate the method with its (updated) complex type

Does this work?

strandedpirate
Posts: 21
Joined: Tue 07 Jan 2014 12:38

Re: How do you update the complex types associated with a stored procedure?

Post by strandedpirate » Fri 07 Feb 2014 12:49

I'm sure that does work however I've setup my complex types to allow nulls for certain columns and not for others. Having to constantly remove and re-create the complex type and method for every small change is a major block because those edits would have to be re-applied. Manually editing the file like I'm doing now is a better approach but obviously not ideal. There needs to be a near frictionless workflow to get the database updates to trickle through ED and into their respective files without a minimum of manual intervention.

There is already a frictionless workflow for updating the entities, this just needs to be extended to the stored procedures/views.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How do you update the complex types associated with a stored procedure?

Post by Shalex » Tue 11 Feb 2014 10:07

I'd like to be able to have ED automatically update the complex type for me using a menu command [...]
I've setup my complex types to allow nulls for certain columns and not for others. Having to constantly remove and re-create the complex type and method for every small change is a major block because those edits would have to be re-applied [...]
There is already a frictionless workflow for updating the entities, this just needs to be extended to the stored procedures/views.
Please submit your request for the feature at http://devart.uservoice.com/forums/3867 ... -developer.

Post Reply