Questions tagged [repository]
For questions about the implementation of the repository design pattern.
145
questions
1
vote
1
answer
11k
views
Using dapper Unit of Work in 3-tier architecture
The Unit of Work:
...
2
votes
1
answer
2k
views
Generic repository with UoW and simple injector
I'm implementing a generic repository + UoW pattern with EF6 and simple injector. I feel there is room for improvements. Please let me know if I left out some relevant code, I tried to keep it breif.
...
3
votes
0
answers
445
views
Generic repository accessor in a unit of work
I'm giving the repository + UoW patterns my first shot on the server side, so bear with me. Also, it's worth mentioning that I haven't used an IoC container on the server side before either, so I'll ...
2
votes
0
answers
513
views
Unit of Work pattern for NHibernate
I have the following code implemented in C# for NHibernate:
...
1
vote
1
answer
438
views
First attempt at Data Driven Design with MVC, to manage a user list
After what I've felt is a sufficient amount of research, I have made my first attempt at a domain driven design MVC project. I would love for you guys to tear it apart and give me pointers to make it ...
3
votes
0
answers
2k
views
Repository pattern with Specification queries
I'm working on an Android (Java) project which utilizes different analytic metrics (sum of x group by date, sum of x group by id, etc) and I am projecting the data sets into different charts using ...
1
vote
0
answers
2k
views
Using IoC Container with Entity Framework Repository Pattern
I am using WPF with Entity Framework 6 (DB first), Caliburn.Micro, and MEF.
I am trying to ...
2
votes
1
answer
115
views
Handing multiple workflows cleanly in LOB application
Background
I'm about to build a LOB application that resembles an e-commerce solution (without paying and being open to the public). It will be used to receive orders for fulfillment purposes based ...
24
votes
0
answers
4k
views
Repository pattern in Rust
I'm looking to add a thin layer of abstraction for database interaction in my application. I'm not really looking for a full blown ORM or advanced query builder.
I am familiar with Diesel, but its ...
1
vote
0
answers
277
views
Rate my implementation of Unif Of Work with Repository pattern and EF Core
I wanted to try something new in regards of design patterns. I have ended up with Unit Of Work with Repository and EF Core. So I just want to display my "real world" solution and maybe hear what you ...
1
vote
2
answers
585
views
Users repository
At work we use almost always the same pattern EF, DAL and BLL. I wish to try something new.
This is the project structure:
And here a code sample with only Users entity:
...
3
votes
0
answers
2k
views
Custom generic repository pattern
This weekend I made an attempt at a generic repository pattern for entity framework in .NET after reading this blog post. I was wondering how it could be better. I specifically have a couple questions....
1
vote
1
answer
1k
views
Instantiate repository classes dynamically
I'm curious about the best way to instantiate my repositories. Currently they're in the main controllers constructor method.
I was thinking making separate controllers for inbounds, outbounds, ...
4
votes
1
answer
887
views
Event sourcing with Python
I've been studying the event sourcing pattern and trying to come up with a set of classes or minimal library I can share across projects.
Below you can find the implementation of this main parts of ...
2
votes
2
answers
129
views
Repository searching code duplication
A followup question to this: IQueryable Extensions working on expression for collection property
I am working on a project for a family member which involves the use of a database and a repository, ...
3
votes
1
answer
374
views
Repository/persistence-service implementation
I have the following situation:
I have...
Models like ServerRoom and ServerCabinet
...
1
vote
2
answers
168
views
Check repository for a nested entity
I have a Product entity and a ProductCategory entity. Given the Product entity, my ...
5
votes
1
answer
8k
views
Cached repository implementation for small lists of data models
I have been using Repositories in my ASP.NET MVC projects and I felt the need to fully cache small tables data (dictionaries, cities, countries etc.). This kind of information is changed (very) ...
4
votes
2
answers
375
views
Mix of Repository and UOW For Business Library with Entity Per Table Architecture
I am trying to use Entity framework along with UOW in business class where I want to use this layer across multiple types of applications like web, webapi and Windows Services. So I cooked something ...
3
votes
1
answer
1k
views
Resository Pattern and Unit of Work with ADO.net
I am trying to implement the Repository Pattern with a Unit of work but I don't know if I am on the right direction. This is my Model:
...
1
vote
2
answers
466
views
PHP OOP Repository overview
I already learned JAVA, a few design patterns (Controllers, etc.) and OOP. I'm trying too build some PHP scripts in OOP (a blog). I want to collect some articles from the DB and store in an array. I'm ...
3
votes
2
answers
5k
views
Simple Repository Pattern without ORM and Unit Tests
I'm trying to implement the repository pattern in the following manner:
Interface:
...
0
votes
1
answer
781
views
My take on implementing the Repository Design Pattern in PHP
The past few weeks I've been trying to grasp on nearly any Design Pattern ever invented, but the repository pattern is one I could understand and implement it myself in my project. My application uses ...
2
votes
1
answer
211
views
Simple repository for a small/medium sized ASP.NET MVC site
I am about to start a small/medium sized project. I am by no means a software architect. But I tend to question every move I make at times, since I want to do things correct.
I found a way to ...
3
votes
1
answer
8k
views
WPF/MVVM with Entity Framework, Repository and Unit of Work pattern
I'm building WPF/MVVM application and I'm struggling implementing Unit of work pattern.
The part, about which I'm not sure is UnitOfWork class. Here is my thought:
...
2
votes
2
answers
833
views
User registration with Repository pattern
I have been developing a simple login registration page with PHP using the repository pattern. Following are the business rules :
During registration
Email must be unique.
Email must be a valid ...
10
votes
1
answer
1k
views
Repository Pattern without an ORM
I'm trying to learn the Repository pattern, and I have some questions regarding my current understanding of it.
All the examples I've been able to find of database repositories use ORMs, but for a ...
2
votes
0
answers
1k
views
Identity repository pattern with UnitOfWork, GenericRepository and Unity
I created an application from 3 layers, DAL, BLL, and Representation layer in ASP.NET Web API. In DAL i have 4 Classes:
- DatabaseContext.cs, UnitOfWork.cs, GenericRepository and UserInfo. In BLL i ...
2
votes
1
answer
2k
views
Repository pattern for books in EF6
I am working on a generic repository. And I wondered if anyone could give some feedback on it.
Interface for DbContext:
...
3
votes
1
answer
3k
views
Repository Pattern universal application
When I started learning Repository Pattern with Unity few days ago I was under impression that the main benefit of this pattern is the separation of data layer from the business layer.
In other words,...
8
votes
1
answer
6k
views
Service-Repository pattern with IoC, NPoco micro-ORM and unit tests
I'm trying to build a Web API using best practices, based on a simple proof-of-concept using students.
My goal is to build the system using:
Onion Architecture to seperate concerns.
Service-...
3
votes
1
answer
552
views
Unity Repository Best Practices
I am now developing a product, which will use Unity & Repositories when it comes to data management. I will demonstrate on a simple example. What we want to do, ...
2
votes
0
answers
1k
views
Web Api Odata Batch processing using UnitOfWork pattern
Unity Configuration
...
2
votes
1
answer
6k
views
DAL basic implementation using Entity framework 6 and Autofac
Would like to ask for a code review for my DAL. I use Entity framework 6 and Autofac for ...
6
votes
1
answer
75
views
Wrapping the Sage300 View API with... a Repository
Related: Something like a LINQ provider
I needed to work with the Sage300 View API. I had never worked with it, but my first impression has been that the API is ...
12
votes
2
answers
315
views
Something like a LINQ provider
Ok, before you ask: yes, I need to do this. Sort of.
I'm wrapping a 3rd-party API for data access, and I can't use an ORM, so I'm implementing this kind of thing:
...
1
vote
0
answers
2k
views
Repository pattern best practices
Which option is better?
In the first case, I use a universal repository that can work with any entities. The methods of this repository have many parameters, such as string queries, table names, ...
2
votes
0
answers
316
views
ASP.NET MVC with automatic testing (follow up)
This is a follow-up of this question regarding MVC application architecture fit for automatic testing.
I have rewritten the DI code based on the answer provided there and also created some tests to ...
1
vote
1
answer
1k
views
ASP.NET MVC application architecture fit for unit testing with mocking
I am trying to learn how to professionally work with unit testing, so I have refactored a medium sized project of mine (a sort of article aggregator that also does some NLP processing) and tried to ...
5
votes
3
answers
2k
views
Unit of Work Pattern for creating users
CreateUser function assumes the data being delivered via parameters are clean and gets called or initiated from the Business Manager (another class). This function is responsible to do the following ...
0
votes
1
answer
675
views
Uploading photos: Domain Model and Repository classes
In the database, I have a table with name photographs with the following columns:
id
...
4
votes
1
answer
2k
views
Choose the right type for method GetById
I designed my repository class and I need some advice from you. Now I have a method GetByID that returns a generic type:
...
4
votes
1
answer
649
views
eCommerce project using the Repository pattern
I am currently working on an eCommerce project in Laravel 5.1. I have implemented Repository Pattern by learning from this site only for 1 model, namely, ...
2
votes
1
answer
1k
views
Different data sources for UnitOfWork and Repository patterns
I was involved in some code-review discussions about UnitOfWork and Repository pattern implementation with EF, which put me in ...
8
votes
1
answer
20k
views
EF Generic Repository + Unit of Work pattern with support for Async
I'm working on a generic repository using EF 6 code first and trying to following the Unit of Work pattern. Unity is being used to inject my repositories, and I'm trying to get everything supporting ...
3
votes
2
answers
607
views
Cookie repository for self-hosted web service
I use this in a self hosted web service, so I am not using a ton of libraries. I wanted a simple yet easy-to-use cookie repository. The reason the repository is static is that I wanted the ability to ...
2
votes
1
answer
143
views
The correct place to implode array - MVC and Repositories concept
I am writing an application with the repositories concept in php with laravel framework.
In my controller I have this method:
...
4
votes
0
answers
4k
views
Hibernate and the Repository Pattern
I have already asked a question on stackoverflow on how to understand the Reporitory Pattern but I'm still having very big troubles in getting a good design implemented on my server. I'm desperately ...
5
votes
4
answers
2k
views
Generic Repository For Web Apps
I was developing a web app using Entity Framework 6 and MVC 5. For the data access layer, I eased the job and wrote a generic repository as following:
...
4
votes
1
answer
5k
views
Returning IQueryable<T> from my repository in Repository pattern design pattern
I am developing an application based on Repository design pattern. What should be the return type from the Repository?
This is my UserRepository class:
...