Comments (2)
Hm... Now we have two different packages: EntityFrameworkCore.CommonTools
for EF Core and EntityFramework.CommonTools
for EF6. If I split them by functionality, I would get 12 separate packages:
EntityFramework.CommonTools.Core
EntityFramework.CommonTools.Auditing
EntityFramework.CommonTools.Concurrency
EntityFramework.CommonTools.Json
EntityFramework.CommonTools.TransactionLog
EntityFramework.CommonTools.Specification
- and 6
EntityFrameworkCore.CommonTools.*
packages
This is very hard to maintain. And also it would not solve your problem:
EntityFramework.CommonTools.Specification
should depends on EntityFramework.CommonTools.Core
which depends on EntityFramework
.
But I can extract a single package which not depends on EntityFramework. It would contain:
- IQueryable Extensions
- JSON Complex Types
- Specification Pattern
The only caveat is that with such package we could not use EF-dependent IQueryable
extensions like .ToListAsync()
:
IQueryable<User> usersQuery = ...;
var spec = new FriendSpecification();
IQueryable<User> friendsQuery = usersQuery
.AsVisitable(new SpecificationExpander())
.Where(u => u.Firends.Any(spec.ToExpression()));
friendsQuery.ToList(); // Ok
friendsQuery.ToListAsync(); // should throw Exception
from entityframework.commontools.
Didn't realize that Specification would depend on Core and EF.
Also didn't think about giving support to both EF 6 and EF Core that is much more relevant than extracting Specification (I was just thinking about my problem :s ).
I now understand your decision of packing everything in the same packages.
It would be nice to have your Specification implementation in a standalone package, but I now understand that the advantages of this implementation come from the integration with EF.
I will still use this implementation whenever I will also need EF.
Thanks
from entityframework.commontools.
Related Issues (7)
- It's not possible to use a string PK HOT 2
- TransactionLog entity does not contain the entityId HOT 3
- Tracking does not work when using context.Update() HOT 5
- Question: Is it possible to separate the Auditable and Trackable interfaces in a different package?
- Misprint in code sample
- Update up to EF Core 3.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entityframework.commontools.