Comments (4)
Hi!
I think that although there is no direct dependency, the dependency on the Data Persistence framework (EF) has "leaked" into the Application layer. If (at some stage of development) it becomes necessary to change the implementation of the repositories to use NHibernate, Dapper, or pure ADO.Net, then we will face many problems. At a minimum, the current interface assumes that the repository implementation can translate Expressions into queries to the Storage, which is not always true. Moreover, the dependency on EF clearly says that you have to use a SQL-oriented database as Storage. The current limitation will not allow me to store data in files, Redis or MongoDB, which I would like to be able to do.
Again, Jason said that it is bad practice to use EF attributes in domain entities - the framework "leaks" to the domain level. So why do we agree that the leaking framework to the Application layer is acceptable?
I believe that in this case, it is worth getting rid of the dependency on EF at the Application level.
from northwindtraders.
Hey @HydraulicCamel
I believe that dependency from the EF Core does not equal dependency from the persistent layer.
The dependency rule works in this case: the application layer can not depend on the data access layer. But it depends (it uses) data access interfaces.
And there is no reference from the Application to Persistence.
But data access interface uses DbSet and depends on EF Core. Is it correct to add EF Core to the application layer?
I believe it is correct because you do not need a repository over DbSet.
The author of the "Entity Framework Core in Action" book suggests adding an EF Core to the Domain layer. I do not think that EF Core in the domain is a good idea. But EF Core in the application works great.
Because you do not use SQL server directly from your code.
What do you think about it?
from northwindtraders.
A lot of valid points have been made in this thread, but I believe Jason has chosen this approach with EF Core for the sake of simplicity. Does this comment provide enough insight?
from northwindtraders.
Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.
from northwindtraders.
Related Issues (20)
- Consistent naming for behaviors HOT 1
- Why is CQRS put in Application and not in WebUI? HOT 2
- Do non-entities core models belong to the domain? HOT 2
- Use ProblemDetails/ValidationProblemDetails etc for exception middleware
- Use ProblemDetails/ValidationProblemDetails etc for exception middleware? HOT 1
- How can we write unit test cases for controllers extending base controller as we are not using constructor injection. any leads will be appreciated. HOT 1
- What's the point of having the IDateTime interface? HOT 2
- FromSqlRaw won't work in Application HOT 2
- ValueObject.Equals bug when objects have a different number of values HOT 1
- [Question] Should JWT/RefreshToken creation be on infrastructure? HOT 1
- Why does it not look like shown in the XAML ControlsGallery App - DataGrid HOT 4
- Dealing with duplication HOT 6
- Application layer access to DbContext? HOT 2
- A better way to do upsert HOT 1
- Suggestion: Request with record type
- something similar HOT 1
- IDbContext and repository pattern HOT 1
- How to call stored procedure for CURD operation? HOT 1
- This repo is pretty old and the projects don't event load in VS 2022 HOT 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 northwindtraders.