For questions about the implementation of the repository design pattern.

learn more… | top users | synonyms

1
vote
0answers
41 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, ...
0
votes
1answer
40 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
2answers
90 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
1answer
94 views

Repository/persistence-service implementation

I have the following situation: I have... Models like ServerRoom and ServerCabinet ...
0
votes
2answers
32 views

Check repository for a nested entity

I have a Product entity and a ProductCategory entity. Given the Product entity, my ...
1
vote
1answer
54 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
2answers
71 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 ...
2
votes
1answer
82 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 dont know if i am on the right direction. This is my Model ...
1
vote
2answers
97 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 ...
0
votes
0answers
26 views

Decouple resource that only lists items owned by logged user

Both methods works just fine, but I would like people's opinion on whether I'm facing this the wrong way. JWTAuth returns an ...
1
vote
2answers
213 views

Simple Repository Pattern without ORM and Unit Tests

I'm trying to implement the repository pattern in the following manner: Interface: ...
0
votes
1answer
110 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 ...
1
vote
1answer
64 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
1answer
1k 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: ...
1
vote
0answers
90 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 ...
2
votes
2answers
75 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 ...
7
votes
1answer
136 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 ...
1
vote
0answers
230 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
1answer
223 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: ...
2
votes
1answer
481 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,...
5
votes
1answer
840 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
1answer
121 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
0answers
272 views
1
vote
1answer
1k 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
1answer
54 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
2answers
173 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: ...
0
votes
0answers
378 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
0answers
113 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
1answer
347 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 ...
4
votes
3answers
848 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
1answer
83 views

Uploading photos: Domain Model and Repository classes

In the database, I have a table with name photographs with the following columns: id ...
3
votes
1answer
347 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: ...
3
votes
1answer
430 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
1answer
397 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 ...
5
votes
1answer
6k 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
2answers
149 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 ...
0
votes
0answers
819 views

MongoDB repository, dynamic objects, Razor Templates

I am writing a repository for MongoDB and are looking for some review at its current state. I am looking for ways to improve it without adding complexity. Should I be using a Singelton pattern for ...
2
votes
1answer
62 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
0answers
2k 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
4answers
515 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: ...
3
votes
1answer
889 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: ...
2
votes
1answer
4k 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 ...
0
votes
1answer
150 views

Separate business logic from Data Access Logic in the repository

I have a PupilService which is calling the PupilRepository.AttachPupil() method. I have an N to M relation between ...
2
votes
1answer
1k views

MVC Repository Insert Using async

This is practically my first time using async in my code. I read about dos-and-donts but I wanted to get some feedback on what I've written. I'm using a repository ...
0
votes
1answer
85 views

Awkward Generic Repository Call [closed]

I am implementing a generic repository pattern. I have done this quite a few times now but every time I do it there is something bugging me. If I have a database design like below. (All the tables ...
7
votes
1answer
3k views

Manage connection without 'using' statement

I replace this common statement: ...
2
votes
1answer
383 views

Replacing IUnitOfWork with a Factory Pattern

As a follow-up to this blog post and this question, I wanted to post my idea of replacing the IUnitOfWork with a factory pattern. It seems to me that in the case of this blog post the IUnitOfWork ...
6
votes
2answers
946 views

Web API using Repository / UnitOfWork

I'm looking for feedback on a repository I set up based on a blog post I read here. I have just recently got more into .NET within the past year, so any feedback and/or best practices that can be ...
2
votes
2answers
242 views

MVC4 Unit Of Work with Entity FrameWork

I am designing a new asp.net MVC4 application. I know that context class generated by EF is Unit of work and Dbset is the repository class. I am just avoiding the extra abstraction. I want to know ...
3
votes
1answer
165 views

Derive currency conversion rates from database, keep it available in a class

I would like to know whether I applied the SOLID principle and the repository pattern the right way. My code should derive exchange rates from a database and do basic currency conversions. The ...