Facet.Extensions.EFCore
1.9.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Facet.Extensions.EFCore --version 1.9.0
NuGet\Install-Package Facet.Extensions.EFCore -Version 1.9.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="Facet.Extensions.EFCore" Version="1.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Facet.Extensions.EFCore" Version="1.9.0" />
<PackageReference Include="Facet.Extensions.EFCore" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Facet.Extensions.EFCore --version 1.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Facet.Extensions.EFCore, 1.9.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.
#:package Facet.Extensions.EFCore@1.9.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Facet.Extensions.EFCore&version=1.9.0
#tool nuget:?package=Facet.Extensions.EFCore&version=1.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Facet.Extensions.EFCore
EF Core async extension methods for the Facet library, enabling one-line async mapping and projection between your domain entities and generated facet types.
Key Features
- Async projection to
List<TTarget>
:ToFacetsAsync<TSource,TTarget>()
- Async projection to first or default:
FirstFacetAsync<TSource,TTarget>()
- Async projection to single:
SingleFacetAsync<TSource,TTarget>()
All methods leverage your already generated ctor or Projection property and require EF Core 6+.
Getting Started
1. Install packages
dotnet add package Facet
dotnet add package Facet.Extensions.EFCore
2. Import namespaces
using Facet.Extensions; // for sync extension methods (built into Facet)
using Facet.Extensions.EFCore; // for async EF Core extension methods
3. Use async mapping in EF Core
// Async projection to list
var dtos = await dbContext.People.ToFacetsAsync<Person, PersonDto>();
// Async projection to first or default
var firstDto = await dbContext.People.FirstFacetAsync<Person, PersonDto>();
// Async projection to single
var singleDto = await dbContext.People.SingleFacetAsync<Person, PersonDto>();
Requirements
- Facet
- .NET 6.0+
- Microsoft.EntityFrameworkCore 6.0+
For provider-agnostic sync and LINQ methods, these are now built into the main Facet package.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Facet (>= 1.9.0)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.