O'Reilly logo

Programming Entity Framework, 2nd Edition by Julia Lerman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Gaining Additional Stored Procedure and View Support in the Raw XML

In Chapter 7, you learned about function mapping and function imports to map stored procedures in the Entity Data Model (EDM). Mapping read, insert, update, and delete stored procedures to entities is the simplest way to use stored procedures in the EDM. Thanks to new Designer features that you worked with in that chapter, it is also now fairly easy to work with stored procedures that return results that don’t map to an entity—by returning complex types instead. There are still a number of scenarios involving stored procedures that haven’t been addressed yet—those that require working directly in the XML of the EDMX file.

This chapter will cover ways to implement stored procedures beyond the function mapping you already performed in the Designer. These additional implementations will create functions that you can call directly in your code.

In addition to implementing stored procedures from your database, you’ll also learn how to create native functions and views directly in your model.

The first part of the chapter will focus on stored procedures that are used for querying the database. The latter part of the chapter will address stored procedures for performing inserts, updates, and deletes in your database. You’ll also learn a few more tricks with respect to database views and user-defined functions along the way.

Reviewing Procedures, Views, and UDFs in the EDM

As you have learned in earlier parts of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required