Entity Framework - Eagerly load object graph using stored procedures

前端 未结 3 1137
情歌与酒
情歌与酒 2021-02-06 10:11

Background

I am changing my LINQ-to-SQL code in my project to Entity Framework. Most of the change over was relatively simple, however, I have run into

3条回答
  •  野的像风
    2021-02-06 10:29

    Stored procedures cannot be directly associated with an Entity for the purposes of selecting / reading data. Typically stored procedures that are used for retrieval will return complex types and not entities. In order to interact with the DB indirectly, EF provides the ability to associate an Entity with a View for reads, and stored procedures for Insert, Update, and Delete.

    Read this article for a full summary of working with EF and stored procedures. http://msdn.microsoft.com/en-us/data/gg699321.aspx

提交回复
热议问题