Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

ivanparvaresh/dotnet-datalayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-datalayer

A simple layer for accessing the database. Wrapping EFCore and Mongodb in a higher layer.

Quick Start

install the library by using to following command:

dotnet add package dotnet-datalayer --version 0.0.1

Create DataContext:

// EFCore
using Dotnet.DataLayer.EntityFramework;
public class MyDataContext : DatabaseContext{
    public MyDatasource(DbContextOptions options) : base(options){}
}

// Mongo
using Dotnet.DataLayer.MongoDb;
public class MyDataContext : DatabaseContext{
    public MyDatasource(DbContextOptions options) : base(options){}
}

Register as service:

services.AddDatabaseContext<MyDataContext>();

public class Client {

    public Client(MyDataContext session){
        
    }
    
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages