For questions about the implementation of the repository design pattern.
1
vote
2answers
116 views
Simple Repository Pattern without ORM and Unit Tests
I'm trying to implement the repository pattern in the following manner:
Interface:
...
0
votes
0answers
58 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 ...
0
votes
0answers
40 views
Simple repository for a small/medium sized asp.net mvc site. Using entity framework
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
180 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
81 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
58 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
110 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
100 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
123 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
174 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
363 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
68 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
135 views
1
vote
1answer
243 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
52 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
150 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
162 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
105 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
230 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
349 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
76 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
260 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
409 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
256 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
3k 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
106 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
558 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
51 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
1k 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
419 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:
...
2
votes
1answer
435 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:
...
1
vote
1answer
2k 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
102 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
767 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
78 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
2k views
2
votes
1answer
210 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
735 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
208 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
141 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
3k views
Identity repository pattern with unit of work
I am creating simple web api/ SPA application using EntityFramework, IUnitOfWork, Repository pattern, Unity DI along with Asp.net Identity.
Unity configuration
...
2
votes
2answers
319 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 ...
9
votes
1answer
3k views
Onion Architecture
After doing a whole bunch of research on Onion Architecture, I have made an attempt at implementing this in a new system that we are developing.
We have the Layers as per below:
Domain
...
1
vote
0answers
243 views
Repository pattern with data access objects
I started a new ASP.NET project in an effort to better learn SQL and Dapper ORM framework.
My idea for data access: Have POCO entities, for each entity have DAO object. When I want to manipulate with ...
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
1answer
426 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
395 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 ...
17
votes
2answers
3k views
Reusable Unit Of Work Interface / Factory
Given my IUnitOfWork interface
using System;
public interface IUnitOfWork : IDisposable
{
void Commit();
}
I then ...
2
votes
1answer
96 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 ...
5
votes
2answers
5k views
Unit of work Repository pattern DBcontext EF-Entities and ninject
I am totally confused while implementing Repository pattern with unit of work and Entity framework because I have seen tons of examples. Please suggest whether I am on the right track or not.
...