Skip to content

Separate EntityFramework APIs into separate package #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jaredcnance opened this issue Jun 6, 2018 · 1 comment
Open

Separate EntityFramework APIs into separate package #292

jaredcnance opened this issue Jun 6, 2018 · 1 comment

Comments

@jaredcnance
Copy link
Contributor

jaredcnance commented Jun 6, 2018

We would like to support other ORMs such as Marten (see #291) and MongoDb (https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb). In order to do this, EF should not be installed unless the developer explicitly chooses it as their ORM. I'd like to see developers install their ORM specific version from the beginning (e.g. dotnet add package JsonApiDotNetCore.EntityFramework) which will bring the base library (JsonApiDotNetCore) in as a transient dependency.

So, the dependency chain will look something like:

JsonApiDotNetCore.EntityFramework -> JsonApiDotNetCore -> Microsoft.AspNetCore., ...
JsonApiDotNetCore.Marten -> JsonApiDotNetCore -> Microsoft.AspNetCore.
, ...
JsonApiDotNetCore.MongoDb -> JsonApiDotNetCore -> Microsoft.AspNetCore.*, ...

The roadmap for doing this will look something like:

  • v2.x : removal of EF APIs into separate project installed by default, dependency chain looks like JsonApiDotNetCore -> JsonApiDotNetCore.EntityFramework. This allows us to begin separation in a non-breaking way.
  • v3 : complete separation and inversion of dependency. This will require application developers to install the new package and possibly change namespaces...(namespace changes could be amortized through deprecations and proxies)...

Blocked by #254

@jaredcnance jaredcnance added this to the v3.0 milestone Jun 6, 2018
@jaredcnance jaredcnance changed the title Separate ORM specific APIs into separate package Separate EntityFramework APIs into separate package Jun 6, 2018
@jaredcnance jaredcnance modified the milestones: v3.0, 4.0 Sep 4, 2018
@wisepotato wisepotato removed this from the v4.0 milestone Oct 9, 2019
@bart-degreed bart-degreed added this to the Future milestone Sep 22, 2020
@bart-degreed
Copy link
Contributor

The current situation is that we have EF Core support built-in and MongoDB support in an external package. But ironically, MongoDB today depends on EF Core-specific code in JADNC to produce its expression trees.

We could make the split today, but the hard question is: what belongs where? Once we have a few implementations for different data storage technologies, we can better answer that question, so I think we should postpone this work for now.

Splitting also means we'll need to untangle bootstrap code that scans EF Core models to build the resource graph and register various IoC container implementations. Without those registrations, JADNC cannot function, because no implementations are registered. In general, it's easier for JADNC consumers to replace a few registrations to customize, rather than first requiring to implement lots of interfaces before a simple request can succeed when not using EF Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants