Entity Framework Core
The implementation of database sessions using Entity Framework Core provides configuration and registration for using EF.
To add Raiqub.Expressions.EntityFrameworkCore library to a .NET project, go get it from Nuget:
shell
dotnet add package Raiqub.Expressions.EntityFrameworkCorepowershell
PM> Install-Package Raiqub.Expressions.EntityFrameworkCoreshell
paket add nuget Raiqub.Expressions.EntityFrameworkCoreDbContext Registration
You need to register the factory of your DbContext by using AddDbContextFactory extension method:
csharp
services.AddDbContextFactory<YourDbContext>();WARNING
Registering using AddDbContext method does not work and will prevent the creation of database sessions.
Register Database Session
Register the session and session factories using the following extension method:
csharp
services.AddEntityFrameworkExpressions()
.AddSingleContext<YourDbContext>();