Questions tagged [repository]

For questions about the implementation of the repository design pattern.

Filter by
Sorted by
Tagged with
3
votes
2answers
1k views

Generic repository object design + static DAL helper

I would like you to review the solution I came up with to the following scenario: In attempting to model a generic Repository object (that receives a generic type parameter) to interface with my data ...
3
votes
1answer
1k views

Refactoring fat ASP.NET MVC Controller

I have just began porting an old project to ASP.NET MVC . In the end, I'll have a lot of controller methods like the one below, called by AJAX requests done by JQGrid objects in the pages: AJAX ...
3
votes
1answer
1k views

Make a testable DAL using service and repository pattern

I'm implementing a Web API that communicates with old WCF services and want to make it future proof. The Web API consists of: API controllers Service Providers Repositories I've implemented a ...
3
votes
2answers
1k views

A flexible unit-of-work + repository pattern

Searching on Stack Overflow and Google, I find many and many different implementation for Unit-of-Work/Repository patterns, but none of that really convinced me; each had some small defect that ...
3
votes
1answer
54 views

Registering an event participant, using Entity Framework and several associated models

I have a method that is responsible for receiving an object and perform the information saved with Entity Framwork, using the Repository pattern. The issue is that this object is, basically, a DTO. ...
3
votes
1answer
272 views

Reduce boilerplate with RepositoryPattern

I'm refactoring a WPF application that uses Repository pattern to access the web services, I've got a tons of repository wrote as ...
3
votes
1answer
60 views

Returning generic types from Repository

Is it bad design if I create repostory with methods that returns generic types. For example in AccountsRepository if I have: ...
3
votes
1answer
312 views

Repository/persistence-service implementation

I have the following situation: I have... Models like ServerRoom and ServerCabinet ...
3
votes
2answers
4k views

Simple Repository Pattern without ORM and Unit Tests

I'm trying to implement the repository pattern in the following manner: Interface: ...
3
votes
2answers
371 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
282 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 ...
3
votes
1answer
976 views

WPF Binding to a Repository with Entity-Framework

I have an MVVM WPF application that will make use of a repository and unit-of-work. This is my Entity Framework database-first model: ...
3
votes
0answers
466 views

Generic Unit of Work implementation

I am implementing the unit of work pattern to be used in the logic layer of my application. The goal is to abstract away the tasks of managing transactions / connections. My implementation relies ...
3
votes
0answers
2k views

Structure and Implementation of Generic Repository and Unit of Work patterns with Dapper and SqlTransactions

I am attempting to update some legacy code that I work with, but my knowledge of data access is limited to a basic use of Entity Framework and simple Dapper. After some research, I have a loose ...
3
votes
0answers
1k views

My implementation of repository pattern in Laravel 5.6

...
3
votes
0answers
359 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 ...
3
votes
0answers
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 ...
3
votes
0answers
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....
2
votes
2answers
391 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 ...
2
votes
1answer
2k 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 ...
2
votes
1answer
126 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: ...
2
votes
1answer
468 views

Controller for repository of members

I tried to implement the Repository pattern for my project: MemberController.php -- this one is a bit too long and has repetitive code ...
2
votes
1answer
97 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 ...
2
votes
2answers
113 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, ...
2
votes
1answer
198 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 ...
2
votes
1answer
5k 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 ...
2
votes
1answer
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 ...
2
votes
1answer
14k 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 ...
2
votes
1answer
3k 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 ...
2
votes
1answer
938 views

IRepository Pattern - Interface Segregation Principle

I have an IRepository class that I use a lot. But I noticed that for many of my repositories I do not implement most of the methods. Also, I usually don't have a ...
2
votes
1answer
143 views

Connecting to an insurance database

I'm developing an Android application which would remotely connect to an insurance database and perform some basic CRUD operations and I'd like to learn how to keep clean app's architecture from ...
2
votes
1answer
186 views

Is this Repository/UOW design workable?

I'm using VS 2013/EF 6/WEB API 2. This application of mine which is working on will eventually grow to be big project and I'm in the very beginning stage and need your expertise to make it simple as ...
2
votes
1answer
85 views

Repository of trainers

This is my first asp.net core web api and i did followed the Repository pattern but i don't know whether this approach is good practice. ...
2
votes
1answer
1k 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. ...
2
votes
1answer
859 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 ...
2
votes
1answer
7k 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
1answer
1k 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
3k views

Calling Stored Procedure “insert query” using EF 6, UOW, and MVC 5

I'm a beginner in MVC programming, repository, and UOW using Entity framework. I tried to calling my existing SP in my MVC project using UOW and EF. Here is my code to mapping my SP in myDbContext ...
2
votes
0answers
25 views

Swift MVVM: Repositories - loading entities and dependency injection

I create a lexikon and a navigation for ZOO. I use MVVM architecture supported by ReactiveSwift. I have a few questions about my practises and whether I could write my repositories better and more ...
2
votes
0answers
918 views

Entity Framework with two databases (with UoW, Repository and Service Layer)

I have two databases: one for a warehouse, second for the office (The db design is out of the scope of this question). There are MANY cross-database funtions. One of those functions is ...
2
votes
0answers
337 views

Unit of Work pattern for NHibernate

I have the following code implemented in C# for NHibernate: ...
2
votes
0answers
980 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
0answers
1k views

Web Api Odata Batch processing using UnitOfWork pattern

Unity Configuration ...
2
votes
0answers
307 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
2answers
341 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: ...
1
vote
1answer
7k views

Using dapper Unit of Work in 3-tier architecture

The Unit of Work: ...
1
vote
1answer
941 views

Repository wrapper

The following implementation is of a repository proxy. I will post only the code for NHibernate Repository here. Everything else (including configurers and tests) ...
1
vote
2answers
358 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 ...
1
vote
1answer
43 views

Showing data for a chat with another user

I have a get route to show the data for a chat with another user. If an existing chat exists I want to return that, otherwise create a new chat and return it. ...
1
vote
1answer
356 views

Cached Repository that can refresh all or a subset of the data

IReadOnlyCachedRepository<T> ...