As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [repository]

For questions about the implementation of the repository design pattern.

Filter by
Sorted by
Tagged with
1 vote
1 answer
11k views

Using dapper Unit of Work in 3-tier architecture

The Unit of Work: ...
Alex Gurskiy's user avatar
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. ...
Johan's user avatar
  • 631
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 ...
Johan's user avatar
  • 631
2 votes
0 answers
513 views

Unit of Work pattern for NHibernate

I have the following code implemented in C# for NHibernate: ...
Sonny Recio's user avatar
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 ...
Halter's user avatar
  • 143
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 ...
emen's user avatar
  • 141
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 ...
Sabyasachi Mukherjee's user avatar
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 ...
James Hill's user avatar
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 ...
kardeiz's user avatar
  • 561
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 ...
Christian's user avatar
  • 111
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: ...
chenny's user avatar
  • 183
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....
Halter's user avatar
  • 143
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, ...
jon.r's user avatar
  • 409
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 ...
user avatar
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, ...
Chris Thompson's user avatar
3 votes
1 answer
374 views

Repository/persistence-service implementation

I have the following situation: I have... Models like ServerRoom and ServerCabinet ...
magueste's user avatar
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 ...
James's user avatar
  • 299
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) ...
Alexei's user avatar
  • 1,786
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 ...
Krishna's user avatar
  • 141
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: ...
STORM's user avatar
  • 217
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 ...
jeremy-vdw's user avatar
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: ...
Alexander D's user avatar
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 ...
Beeelze's user avatar
  • 101
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 ...
Mathias Hove's user avatar
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: ...
Marshall's user avatar
  • 131
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 ...
Rumel's user avatar
  • 239
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 ...
jpt's user avatar
  • 101
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 ...
Kob_24's user avatar
  • 131
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: ...
infis99's user avatar
  • 21
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,...
Robert J.'s user avatar
  • 165
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-...
Gaui's user avatar
  • 621
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, ...
Robert J.'s user avatar
  • 165
2 votes
0 answers
1k views

Web Api Odata Batch processing using UnitOfWork pattern

Unity Configuration ...
Mukesh's user avatar
  • 21
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 ...
user avatar
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 ...
Mathieu Guindon's user avatar
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: ...
Mathieu Guindon's user avatar
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, ...
Alexandr's user avatar
  • 371
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 ...
Alexei's user avatar
  • 1,786
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 ...
Alexei's user avatar
  • 1,786
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 ...
Coder Absolute's user avatar
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 ...
PeraMika's user avatar
  • 209
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: ...
Roman Marusyk's user avatar
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, ...
Saiyan Prince's user avatar
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 ...
Jevgenij Nekrasov's user avatar
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 ...
jdylanmc's user avatar
  • 183
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 ...
Joachim's user avatar
  • 205
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: ...
Rafael Soufraz's user avatar
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 ...
Stefan Falk's user avatar
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: ...
Akbari's user avatar
  • 179
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: ...
Vivekanand V V's user avatar