Impatient.EntityFrameworkCore.SqlServer 2.1.2

dotnet add package Impatient.EntityFrameworkCore.SqlServer --version 2.1.2                
NuGet\Install-Package Impatient.EntityFrameworkCore.SqlServer -Version 2.1.2                
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="Impatient.EntityFrameworkCore.SqlServer" Version="2.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Impatient.EntityFrameworkCore.SqlServer --version 2.1.2                
#r "nuget: Impatient.EntityFrameworkCore.SqlServer, 2.1.2"                
#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 Impatient.EntityFrameworkCore.SqlServer as a Cake Addin
#addin nuget:?package=Impatient.EntityFrameworkCore.SqlServer&version=2.1.2

// Install Impatient.EntityFrameworkCore.SqlServer as a Cake Tool
#tool nuget:?package=Impatient.EntityFrameworkCore.SqlServer&version=2.1.2                

Supports EF Core 2.1.0 with SQL Server 2016+.

After installing, configure your DbContext like this:

services.AddDbContext<NorthwindDbContext>(options =>
{
    options
        .UseSqlServer(connectionString)
        .UseImpatient();
});

Use Impatient with EF Core for SQL Server to get the most out of LINQ queries.

Impatient speaks JSON, so you can fetch dense result sets in one trip:

from e in employees
select new
{
    e.FirstName,
    e.LastName,
    RecentOrders = 
        (from o in e.Orders
         orderby o.OrderDate descending
         select o).Take(5).ToList(),
    TopCustomers = 
        (from o in e.Orders
         from d in o.OrderDetails
         group d by o.Customer into g
         let total = g.Sum(d => d.UnitPrice * d.Quantity * (decimal)(1 - d.Discount))
         orderby total descending
         select new
         {
             g.Key.ContactName,
             g.Key.CompanyName,
             total
         }).Take(5).ToList()
}
SELECT [e].[FirstName] AS [FirstName], [e].[LastName] AS [LastName], (
    SELECT TOP (5) [o].[OrderID] AS [OrderID], [o].[CustomerID] AS [CustomerID], [o].[EmployeeID] AS [EmployeeID], [o].[OrderDate] AS [OrderDate]
    FROM [Orders] AS [o]
    WHERE [o].[EmployeeID] = [e].[EmployeeID]
    ORDER BY [o].[OrderDate] DESC
    FOR JSON PATH
) AS [RecentOrders], (
    SELECT TOP (5) [c].[ContactName] AS [ContactName], [c].[CompanyName] AS [CompanyName], SUM(([o_0].[UnitPrice] * CAST([o_0].[Quantity] AS decimal(18, 2))) * CAST(1 - [o_0].[Discount] AS decimal(18, 2))) AS [total]
    FROM [Orders] AS [o_1]
    INNER JOIN [Order Details] AS [o_0] ON [o_1].[OrderID] = [o_0].[OrderID]
    LEFT JOIN (
        SELECT [c_0].[CustomerID] AS [CustomerID], [c_0].[Address] AS [Address], [c_0].[City] AS [City], [c_0].[CompanyName] AS [CompanyName], [c_0].[ContactName] AS [ContactName], [c_0].[ContactTitle] AS [ContactTitle], [c_0].[Country] AS [Country], [c_0].[Fax] AS [Fax], [c_0].[Phone] AS [Phone], [c_0].[PostalCode] AS [PostalCode], [c_0].[Region] AS [Region]
        FROM [Customers] AS [c_0]
    ) AS [c] ON [o_1].[CustomerID] = [c].[CustomerID]
    WHERE [o_1].[EmployeeID] = [e].[EmployeeID]
    GROUP BY [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
    ORDER BY SUM(([o_0].[UnitPrice] * CAST([o_0].[Quantity] AS decimal(18, 2))) * CAST(1 - [o_0].[Discount] AS decimal(18, 2))) DESC
    FOR JSON PATH
) AS [TopCustomers]
FROM [Employees] AS [e]

For more information, see the project site.

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 netcoreapp2.1 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.2 34,100 8/16/2018
2.1.1 1,997 6/14/2018
2.1.0 1,424 5/30/2018
2.1.0-rc1-final 765 5/18/2018
2.0.0 1,609 4/23/2018