EF Mapping to Read Stored Procs, another twist

Entity Framework easily supports mapping to read stored procedures when the query results match up with an existing entity in the model. If your query results don’t, then you have to create a new read only entity and entity set in the CSDL and a new “fake table” entity and entity set in the SSDL and then you can do the mappings. (I show how to do that in this blog post.)

Chris Snyder found a new twist. What if the result matches an entity, but some of the fields inthe result have been renamed? Unless you wanted to create a read only entity to match it. But then you won’t get the change tracking benefits of a entity with a key.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

2 thoughts on “EF Mapping to Read Stored Procs, another twist

    1. Thanks Rodney. Link is fixed. A lot of old links broke when I ported my blog a few years ago. Keep in mind that this is 10 year old content about a very old version of Entity Framework.

Leave a Reply to Julie Lerman Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.