3,226 questions
-3
votes
1
answer
83
views
Should one service call another service or use the repository directly? [closed]
I'm learning Clean Architecture and I can't figure this out.
Imagine this scenario: I have a ServiceA that calls its repository:
public class ServiceA : IServiceA
{
private readonly IRepositoryA ...
1
vote
0
answers
89
views
How to use database transactions in the repository pattern
I would like to know how to use the repository pattern with Prisma transactions.
I am using OAuth, so when the user authenticates, I need to populate the user, account and session tables. If any of ...
0
votes
0
answers
48
views
Separating Firebase logic from business logic in Swift using Service-Repository pattern
I have this function in my TaskService:
func deleteTask(task: DistributionTask) async throws -> Void {
let (tasksCollection, userTasksIdsField, teamTasksIdsField) = task.isCompleted
...
2
votes
3
answers
209
views
Unit test with real database in repository pattern?
I have an ASP.NET Core Web API and services. To abstract EF Core's DbContext from service layer, I decided to use the repository pattern.
However, the repository contains logic that cannot be unit ...
3
votes
0
answers
230
views
How to avoid unnecesary Idle in transaction in FastAPI - SQLAlchemy application with repository pattern?
This question is inspired by the articles https://www.gorgias.com/blog/prevent-idle-in-transaction-engineering and https://capnfabs.net/posts/sqlalchemy-connection-management/.
SQLALchemy session ...
0
votes
1
answer
78
views
Entity Framework Repository Pattern Dynamic Where and Or Where Clause
Using the Dynamic where here
Entity Framework Core Dynamic Where Clause
I am able to have a where on any column in any table, accessed by property name, using an Entity Framework typed repository ...
0
votes
0
answers
62
views
ConnectionMultiplexer exception caused when trying to invoke webAPI endpoints -
I am facing an exception(ConnectionMultiplexer) message when trying to access a .NetCore 8 webAPI endpoint. I tried to use repositoryPattern in my project so there's a GenericRepository interface. I ...
0
votes
0
answers
73
views
How can i implement Repository designing pattern for mern project
How can I implement the repository design pattern in a MERN stack project? Also, how should I configure the database ,logic's to follow the repository pattern?
what is the abstraction layer in ...
1
vote
3
answers
300
views
How to use DTOs from application layer in domain layer repository interface (repository pattern)?
I am learning ASP.NET clean architecture structure. I have an application layer with a query GetAllRestaurants which has to return paginated restaurant objects.
I am using repository pattern, with the ...
0
votes
1
answer
38
views
How to achieve method autocomplete for repository pattern in Python with VSCode?
I'm implementing a repository pattern in Python for my project and using VSCode as my IDE. However, I'm having trouble with method autocompletion for instances of my repository classes. When I type db....
3
votes
3
answers
256
views
Repository and DAO together at Java program
I'm studying the Repository pattern and I am a bit cnfuse.
I'd like to know if it is possible this pattern coexists with DAO pattern.
I have implemented a simple Java program that persists data in ...
0
votes
2
answers
175
views
Dependency injection with generic repository pattern
I recently wrote a program using the repository pattern to cover CRUD operations. Now, my question is how I can further optimize it and how I can integrate it with dependency injection.
So far, I've ...
0
votes
2
answers
76
views
How to update database of parent class and [Owned] attribute class type in Entity Framework Core 8.0.8
How to save the [Owned] attribute class data from parent class into the database.
This is the parent class:
[Index(nameof(EmailId),IsUnique =true)]
public class User : Entity, IUser
{
[Required(...
0
votes
1
answer
87
views
How do I structure my Hilt modules to provide an Api and Room to my repository?
I have an application that, for now, only makes some API calls when started and shows the result on screen, so my ViewModel directly commmunicates with the Api (I know that's not right). However, I ...
0
votes
1
answer
47
views
Where should database calls that return primitive types be located and who should be calling them, Application Services or Domain Services?
As far as I know Repositories should work with Domain/Business Entities. All the operations to save and retrieve data to create entities should go there, and then the Repository is used by the Domain ...
0
votes
1
answer
43
views
Synchronizing context with the database
Desktop; WPF + MVVM, Prism, Entity Framework, UnitOfWork + Repository.
UnitOfWork was initialized on two computers at the same time. someUser was added on the first PC.
How can I get someUser in ...
0
votes
1
answer
47
views
How to Create a Generic Repository in C# that Handles Both BaseEntity and IdentityUser<int> Types?
I am developing a management system and I am using the identity library for members. But I have a problem that I could not overcome. I have my own repository structure here and I need to use this ...
3
votes
2
answers
456
views
How to implement a Repository in DDD correctly
I have a question regarding DDD and the repository pattern.
I have an AggregateRoot Report that has Transactions (which is an Entity Array).
I used to have a CRUD repository and when I was modifying a ...
0
votes
1
answer
118
views
Angular dependency injected classes: how to hold different information in a single class
I am quite new to this so apologies if these are obvious questions, but I have not found a answer from Googling.
My Angular application needs to access data from a large number of JSON files. These ...
0
votes
1
answer
562
views
EF Core | Adding a related entity | The database operation was expected to affect 1 row(s), but actually affected 0 row(s)
Unable to figure out why I am getting the following error:
{
"title": "Server Error",
"status": 500,
"detail": "The database operation was expected ...
1
vote
0
answers
303
views
Drizzle - Convert pg SelectedFields to plain type
I'm currently using Drizzle in a project and have implemented a repository pattern for the connection with Drizzle. The issue is that within the base class of the repositories, I have this method ...
0
votes
0
answers
27
views
Have a Repository Method Analyze Multiple Tables
In building complex calls with the repository pattern for the first time, I'm researching best practices.
The response in this post Having a repository dependent on another repository seems to suggest ...
0
votes
0
answers
34
views
Shipping an "example" directory (intended for deletion) in a Git repository
In a project that uses directories or files as part of presentation, you might want to ship some examples. But if those examples actually affect the final presentation, the expectation would be for ...
0
votes
0
answers
60
views
Abstract one layer of database connection to another class
I might add more methods but currently I have this design:
So connectionString comes from IOptions pattern.
Then for each method I am repeating myself to open the connection in this part of the code ...
1
vote
0
answers
61
views
Using Repository pattern to fetch data from different places and build list of objects
My spring boot project is structured so that i have modules contract (that handles incoming requests) and impl (that deals with the logic). Contract has a facade that passes the request to a facade in ...