Questions tagged [unit-of-work]
The unit-of-work tag has no usage guidance.
46
questions
4
votes
2
answers
522
views
Is the entire web request the right scope for a DbContext in EF Core?
The usual advice for using EF Core in a web application is to use a scoped DbContext per HTTP request. This is even the suggested default for web application in the Microsoft documentation. I recently ...
2
votes
1
answer
228
views
two diffrent database in unit of work
I will explain my problem in the form of an example.
Suppose we want to use both databases in a transaction.
Data is edited in database 1 (for example, Postgres) and then added to database 2. Finally, ...
1
vote
2
answers
321
views
Using multiple databases in a bounded context
Sometimes we have to use multiple databases in one project
with the intentions of:
Denormalizing data or read models
Using the advantages of that database (technology)
There has been a lot of talk ...
0
votes
0
answers
238
views
Implementing the Repository/UnitOfWork pattern using Azure.Data.Tables "TableClient"
I currently have a generic Azure repository AzureRepository<TEntity> store internally a list of table transaction actions like so.
private readonly IList<TableTransactionAction> ...
0
votes
1
answer
3k
views
Where to put SaveChanges in unit of work?
For the sake of discussion, you can assume I'm using Entity Framework and a mediator pattern implementation in .NET.
I'm going back and forth trying to decide how to structure some of my data access ...
6
votes
3
answers
14k
views
Is unit of work pattern really needed with repository pattern
I am trying to use EF6 with my project. I just watched Repository Pattern with C# and Entity Framework, Done Right | Mosh video. I understand the necessity of Repositories but I still don't understand ...
8
votes
2
answers
7k
views
Avoiding Repository pattern - implementing Onion Architecture with DbContext only
I am trying to follow the Onion Architecture to design my application where I have the following layers -
Domain Layer: is the inner-most layer and defines repository interfaces
Infrastructure ...
0
votes
2
answers
3k
views
c# Manage more Repository in UnitOfWork
I have a question about how can manage multiple repositories with unit of work.
I thought for two solutions but I'm not sure.
The first is a classic solution where the IUnitOfWork interface looks like ...
3
votes
1
answer
775
views
Saga vs. Unit of work
What's the relationship between the two?
Both are for atomic operations. Both results need to be either success, or failure with rollback to original state.
-1
votes
1
answer
3k
views
Update Entity for Repository Pattern and UOW Pattern C#
In one mock solution, I have created 3 mock projects to implement layered architecture design mainly the - Presentation Layer (Web) - Domain Model Layer - Infrastructure Layer. I haven't yet to add ...
1
vote
2
answers
1k
views
How to get ORM (Ef Core) Entities follow a DDD style . Which is the best approach?
I am considering mutliple options to face a problem.
I want to develop software following DDD style.
The problem arise when I have to define my entities and I am working with Entity Framework Core, ...
1
vote
3
answers
681
views
Tracking state on entity and unit-of-work pattern
In my web app I have a long running operation that is processing some entity in the background. The state of this process should be visible to the clients. During the processing the UI should show ...
3
votes
2
answers
1k
views
Should a UnitOfWork contain every Repository?
I'm trying to get the Repository/UnitOfWork pattern figured out. We're working on a project with EntityFramework and our DBContext contains 200+ tables.
Right now our approach is to inject whatever ...
5
votes
2
answers
17k
views
Unit Of Work with multiple database context
I have created an application (net core 2 & ef core) with Unit Of Work and Generic repository pattern. I used to have one database context but due to some business logic I had to create a second ...
3
votes
2
answers
3k
views
Unit of work + repository pattern + dependency injection
I am in the process of refactoring and improving a codebase. One of the major missing features is transactional safety and certain errors arising from each repository having its own DbContext.
The ...