Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.
Now you’ll modify the model so that the Entity Framework will use the UpdateOrder stored procedure defined in the database instead of generating its own command. You’ll do this by mapping the UpdateOrder stored procedure to the Order entity in the designer. This is referred to as Stored Procedure Mapping or Function Mapping.
1.In the designer, right click on the Order entity and select Stored Procedure mapping.
2.Click select Function="" Insert="" and then click the drop down arrow that appears. This exposes the list of all Functions found in the Store metadata.
3.Select InsertOrder from the list. The designer will do its best job of matching the stored procedure’s parameters with the entity properties using the names. In this case, since all of the property names match the parameter names, it maps every one correctly so you don’t need to make any changes. One thing that the designer was not able to map is the newly generated SalesOrderID returned by the stored procedure. This is because the designer is not able to automatically detect the name of the field being returned.
4.Under the Result Column Bindings section, click add Binding="" Result="" and enter SalesOrderID. The designer should automatically select the entity key property, OrderID, for this final mapping.
When completed, Figure 6 displays what the mapping should look like.
|Interview questions for support of a legacy ASP.NET site||4||40|
|IIS Express Working in one Visual Studio Solution, but not in another. Why?||2||16|
|.NET tools for adding thread safety to a web app?||3||19|
|Not seen Link button||5||19|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
25 Experts available now in Live!