StoredProcedureEFCore 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package StoredProcedureEFCore --version 0.2.0
NuGet\Install-Package StoredProcedureEFCore -Version 0.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StoredProcedureEFCore" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StoredProcedureEFCore --version 0.2.0
#r "nuget: StoredProcedureEFCore, 0.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StoredProcedureEFCore as a Cake Addin
#addin nuget:?package=StoredProcedureEFCore&version=0.2.0

// Install StoredProcedureEFCore as a Cake Tool
#tool nuget:?package=StoredProcedureEFCore&version=0.2.0

Execute stored procedures with Entity Framework Core

DbContext extension with LoadStoredProc method which creates an IStoredProcBuilder.

The method handles :

  • Extra column in result set
  • Extra property in model
  • Null values in result set
  • Underscores or hypens in result set column names ("column_name" is mapped to ColumnName property)
  • Int (db) to enumeration (result model) mapping


List<Model> rows = null;

   .AddParam<T>("limit", 300L)
   .AddParam<T>("limitOut", out IOutParam<long> limitOut)
   .Exec(r => rows = r.ToList<Model>());

long limitOutValue = limitOut.Value;

   .AddParam<T>("boolean_to_return", true)
   .ReturnValue(out IOutParam<bool> retParam)

bool b = retParam.Value;

   .AddParam<T>("limit", 1L)
   .ExecScalar(out long l);



IStoredProcBuilder             LoadStoredProc(string name)


List<T>                        ToList<T>()
Dictionary<TKey, TValue>       ToDictionary<TKey, TValue>()
Dictionary<TKey, List<TValue>> ToLookup<TKey, TValue>()
HashSet<T>                     ToSet<T>()
List<T>                        Column<T>()
T                              First<T>()
T                              FirstOrDefault<T>()
T                              Single<T>()
T                              SingleOrDefault<T>()


IStoredProcBuilder             AddParam<T>(string name, T val)                             // Input parameter
IStoredProcBuilder             AddParam<T>(string name, T val, out OutParam<T> outParam)   // Ouput parameter
IStoredProcBuilder             AddParam<T>(string name, out IOutParam<T> outParam)         // Input/Ouput parameter
IStoredProcBuilder             ReturnValue<T>(out IOutParam<T> retParam)
void                           Exec(Action<IDataReader> action)
void                           ExecNonQuery()
void                           ExecScalar<T>(out T val)


Install-Package StoredProcedureEFCore

Why ?

Stored procedure execution is not supported in entity framework core:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.1 is compatible.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (10)

Showing the top 5 NuGet packages that depend on StoredProcedureEFCore:

Package Downloads

Package Description


Package Description


Package Description


Package Description


Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 368,543 11/15/2020
1.0.4 77,388 6/16/2020
1.0.3 1,173 6/15/2020
1.0.2 11,118 4/10/2020
1.0.1 14,482 2/13/2020
1.0.0 6,485 1/14/2020
0.3.15 17,740 10/30/2019
0.3.14 5,259 10/22/2019
0.3.13 1,276 10/17/2019
0.3.12 1,629 8/9/2019
0.3.11 15,823 6/1/2019
0.3.10 21,716 11/15/2018
0.3.9 9,746 5/4/2018
0.3.8 2,218 4/21/2018
0.3.7 1,954 4/3/2018
0.3.6 2,010 3/16/2018
0.3.5 1,777 3/16/2018
0.3.4 2,039 3/2/2018
0.3.3 2,074 2/1/2018
0.3.2 1,924 1/19/2018
0.3.1 1,943 1/8/2018
0.3.0 1,917 1/8/2018
0.2.0 2,053 12/29/2017
0.1.1 2,021 12/28/2017
0.1.0 1,920 12/26/2017