Code Monkey home page Code Monkey logo

leaderanalytics / adaptiveclient.entityframeworkcore Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 4.0 102 KB

Utility classes and methods for using AdaptiveClient to work with DBContext and other Entity Framework Core objects. Build loosely coupled services, readily accessible via a lightweight façade. Easily build your service layer to use multiple providers (MSSQL, MySQL, SQLite) with no additional infrastructure. Use connection string objects to as keys to resolve specific implementations of DbContext for migrations and testing.

License: GNU Lesser General Public License v3.0

C# 100.00%
entity-framework-core dependency-injection autofac n-tier-architecture soa

adaptiveclient.entityframeworkcore's Introduction

AdaptiveClient.EntityFrameworkCore

Utilities for using AdaptiveClient to work with DBContext and migrations.


Get the Nuget package


Change log

2022-12-27 v4 - Migrate to .net 7 / EF 7.

2021-02-07 v2.0.0 - Migrate to .net 5. Drop support for .net framework. Update Entity Framework dependencies to EF Core 5.

Classes

DatabaseUtilities

  • Use an IEndPointConfiguration to resolve a DbContext. Check status of resolved DbContext or perform other operations such as applying migrations or dropping the database.

DatabaseValidationResult

  • Returns names of applied migrations, if any, and if database was created.

Structures

DatabaseStatus

  • Enum that provides status of a given database: Unknown, DoesNotExist, NotConsistentWithModel, ConsistentWithModel.

Interfaces

IDataBaseUtilities

  • Methods for resolving and working with DbContext. See DatabaseUtilities implementation.

IDatabaseInitializer

  • Method for seeding a database when it is created or when a migration is applied.

IDbContextOptions

  • An interface for keying DbContextOptions.

IMigrationContext

  • A placeholder interface for keying a MigrationContext

RegistrationHelper Extensions

  • RegisterDbContext - Keys a class derived from DbContext to an API_Name.
  • RegisterDbContextOptions - Keys a class that implements IDbContextOptions to a specific provider such as MSSQL or MySQL.
  • RegisterMigrationContext - Allows EntityFramework to reflect on an assembly and resolve a DbContext to a specific provider such as MSSQL or MySQL.
  • RegisterDatabaseInitializer - Keys a class that provides initialization services such as seeding a newly created database.

ResolutionHelper Extensions

  • ResolveDbContext - Resolves a DbContext instance using keys provided by a IEndPointConfiguration parameter.
  • ResolveDbContextOptions - Resolves an instance of DbContextOptions using keys provided by a IEndPointConfiguration parameter.
  • ResolveMigrationContext - Resolves an implementation of IMigrationContext using keys provided by a IEndPointConfiguration parameter.
  • ResolveDatabaseInitializer - Resolves an implementation of IDatabaseInitalizer using keys provided by a IEndPointConfiguration parameter.

adaptiveclient.entityframeworkcore's People

Contributors

abcd1237 avatar leaderanalytics avatar sam-wheat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.