Questions tagged [repository]

For questions about the implementation of the repository design pattern.

Filter by
Sorted by
Tagged with
3 votes
0 answers
428 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 ...
user avatar
  • 631
2 votes
0 answers
482 views

Unit of Work pattern for NHibernate

I have the following code implemented in C# for NHibernate: ...
user avatar
1 vote
1 answer
426 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 ...
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 ...
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 ...
user avatar
2 votes
1 answer
113 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 ...
user avatar
24 votes
0 answers
3k 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 ...
user avatar
  • 561
1 vote
0 answers
275 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 ...
user avatar
  • 111
1 vote
2 answers
548 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: ...
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....
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, ...
user avatar
  • 419
4 votes
1 answer
849 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
120 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, ...
user avatar
3 votes
1 answer
366 views

Repository/persistence-service implementation

I have the following situation: I have... Models like ServerRoom and ServerCabinet ...
user avatar
1 vote
2 answers
161 views

Check repository for a nested entity

I have a Product entity and a ProductCategory entity. Given the Product entity, my ...
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) ...
user avatar
  • 1,786
4 votes
2 answers
354 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 ...
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: ...
user avatar
  • 217
1 vote
2 answers
455 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 ...
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: ...
user avatar
0 votes
1 answer
749 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 ...
user avatar
  • 101
2 votes
1 answer
206 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 ...
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: ...
user avatar
  • 131
1 vote
0 answers
131 views

Repository pattern implementation

I'm in the process of delving into different design patterns and trying to implement them into my daily work routine. I come from an unstructured world of PHP and not understanding how to utilize it ...
user avatar
  • 419
2 votes
2 answers
778 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 ...
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 ...
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 ...
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: ...
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,...
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-...
user avatar
  • 621
3 votes
1 answer
542 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, ...
user avatar
  • 165
2 votes
0 answers
1k views

Web Api Odata Batch processing using UnitOfWork pattern

Unity Configuration ...
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
73 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 ...
user avatar
12 votes
2 answers
298 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: ...
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, ...
user avatar
  • 371
2 votes
0 answers
313 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 ...
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 ...
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 ...
user avatar
0 votes
1 answer
585 views

Uploading photos: Domain Model and Repository classes

In the database, I have a table with name photographs with the following columns: id ...
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: ...
user avatar
4 votes
1 answer
636 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, ...
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 ...
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 ...
user avatar
3 votes
2 answers
581 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 ...
user avatar
  • 205
2 votes
1 answer
142 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: ...
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 ...
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: ...
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: ...
user avatar
2 votes
1 answer
17k views

Table join using the repository pattern

I am new to repository pattern. If I want to join two tables, where should I implement the logic? I have implemented it as shown below. Is there any better way to achieve the same? This is my ...
user avatar