Go to file
2021-08-13 02:58:40 -04:00
PoweredSoft.Data Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
PoweredSoft.Data.Core Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
PoweredSoft.Data.EntityFramework Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
PoweredSoft.Data.EntityFrameworkCore Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
PoweredSoft.Data.InMemory Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
PoweredSoft.Data.MongoDB Upgrading to EF5.0 2021-08-13 02:58:40 -04:00
.gitattributes Add .gitignore and .gitattributes. 2018-11-23 01:22:02 -06:00
.gitignore Add .gitignore and .gitattributes. 2018-11-23 01:22:02 -06:00
Data.sln in memory. 2021-08-11 17:39:06 -04:00
LICENSE.md Add project files. 2018-11-23 01:22:05 -06:00
README.md Update README.md 2021-08-11 17:43:45 -04:00

Goal

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 reason 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 NuGet PM> Install-Package PoweredSoft.Data
PoweredSoft.Data.EntityFramework NuGet PM> Install-Package PoweredSoft.Data.EntityFramework
PoweredSoft.Data.EntityFrameworkCore NuGet PM> Install-Package PoweredSoft.Data.EntityFrameworkCore
PoweredSoft.Data.MongoDB NuGet PM> Install-Package PoweredSoft.Data.MongoDB
PoweredSoft.Data.InMemory NuGet PM> Install-Package PoweredSoft.Data.InMemory

In your application you may do the following

public class Startup
{
    public void ConfigureServices(IServiceCollection services) 
    {
        // for mongo.
        services.AddPoweredSoftMongoDBDataServices();

        // for ef core
        services.AddPoweredSoftEntityFrameworkCoreDataServices();
        
        // for in memory 
        services.AddPoweredSoftInMemoryDataServices();
    }
}

AsyncQueryableService

Also as the same kind of goal, will slowly add support for a non dependant to orm/drivers async method.

public interface IAsyncQueryableHandlerService
{
    Task<T> FirstOrDefaultAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
    Task<T> FirstOrDefaultAsync<T>(IQueryable<T> queryable, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default(CancellationToken));
    Task<List<T>> ToListAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
    Task<int> CountAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
    Task<long> LongCountAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
    Task<bool> AnyAsync<T>(IQueryable<T> queryable, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default(CancellationToken));
    Task<bool> AnyAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default(CancellationToken));
    bool CanHandle<T>(IQueryable<T> queryable);
}

How to use

public class SomeClass
{
    private readonly IAsyncQueryableService asyncQueryableService;
    public SomeClass(IAsyncQueryableService asyncQueryableService)
    {
        this.asyncQueryableService = asyncQueryableService;
    }

    public async Task<T> GetFirstAsync(IQueryable<T> query) {
        return await this.asyncQueryableService.FirstOrDefaultAsync(query);
    }
}