Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Calling a Stored Procedure from Entity Framework - EF6

RSS
Modified on Wed, Jan 29, 2020, 12:30 PM by Administrator Categorized as Entity Framework Code First

With Result Set

  • OrderDetail is a class that represents one row of the result set.

using (var db = new MyDataModel())
{
    var p1 = new SqlParameter("@OrderId", orderId);

    var sql = "dbo.GetOrderDetails @OrderId";

    var q = db.Database.SqlQuery<OrderDetail>(sql, p1).ToList();
}

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.