Questions tagged [repository]

For questions about the implementation of the repository design pattern.

Filter by
Sorted by
Tagged with
3
votes
1answer
83 views

Refactoring code to implement clean code using repositories

I've been refactoring code today, try to implement a clean code setup using repositories. Is this on track? Can any improvements be made? ...
3
votes
1answer
9k views

Generic Repository without Entity Framework

Almost all of generic repository pattern tutorials were making use of EF, so I haven't got much sources to compare my code with. Here is what I have done. Could you please suggest me to fix my wrongs ...
3
votes
1answer
530 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, ...
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
127 views

Is it okay to use multiple repositories from inside a single service implementation in Spring?

I currently have two entities, Adress and Company. They both have DTOs to perform CRUD ...
3
votes
1answer
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: ...
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
55 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
298 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
69 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
354 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
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: ...
3
votes
2answers
387 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
283 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
1k 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
996 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
398 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
521 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
133 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
472 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
99 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
116 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
203 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
16k 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
1k 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
149 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
187 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
107 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
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. ...
2
votes
1answer
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: ...
2
votes
1answer
4k 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
43 views

A UserService method that calls the UserRepository a few times

I'm trying to implement some domain driven design architecture, such as a repository to talk to the database, and a service that talks to the repository. I have an action where I want to see if a User ...
2
votes
0answers
55 views

Unit testing the code that is written using repository pattern

I have implemented my business logic using the repository pattern. I have an Approve method in my controller. I am calling the service method ...
2
votes
0answers
56 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
787 views

Repository + Unit Of Work Pattern in WebAPI

I am refactoring my existing product's webapi part of the solution. Current Repo pattern does not allow me to add custom functions to a specific repository. In result, most of the functions directly ...
2
votes
0answers
1k 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
409 views

Unit of Work pattern for NHibernate

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

Web Api Odata Batch processing using UnitOfWork pattern

Unity Configuration ...