dotnet-data/README.md
2018-11-23 01:29:16 -06:00

2.3 KiB

IDbContextFactory

The goal of this project is to help, fill the gap of supporting multiple ORM's in DynamicQuery, and possibly more projects in the future.

One of the most obvious reasy is to be able to execute async/await operations on the context without, the executing library to be dependant on the ORM Framework such as (EF Core, EF6).

Getting Started

Install nuget package to your awesome project.

Full Version NuGet NuGet Install
PoweredSoft.Data.Core NuGet PM> Install-Package PoweredSoft.Data.Core
PoweredSoft.Data.EntityFrameworkCore NuGet PM> Install-Package PoweredSoft.Data.EntityFrameworkCore

In your application you may do the following

public class Startup
{
    public void ConfigureServices(IServiceCollection services) 
    {
        services.AddPoweredSoftDataServices();
    }
}

Then somewhere else.

public class SomeClass
{
    private readonly IDbContextFactory contextFactory;
    public SomeClass(IDbContextFactoryProvider dbContextFactoryProvider)
    {
        contextFactory = dbContextFactoryProvider.GetContextFactory(typeof(YourFavoriteContext));
    }
}