tagged [repository]

Using repository pattern to eager load entities using ThenIclude

Using repository pattern to eager load entities using ThenIclude My application uses Entity Framework 7 and the repository pattern. The GetById method on the repository supports eager loading of child...

How to design a Repository Pattern with Dependency Injection in ASP.NET Core MVC?

How to design a Repository Pattern with Dependency Injection in ASP.NET Core MVC? Being fairly new to ASP.NET Core 1.0 MVC, I have decided to use a Repository Pattern for an MVC Core app; I'm using a ...

Is injecting service into another service bad practice?

Is injecting service into another service bad practice? I am creating a web application that is tiered in the following way: Controller > Service > Repository So it's following a service and repositor...

6 Jun at 22:18

How to move some files from one git repo to another (not a clone), preserving history

How to move some files from one git repo to another (not a clone), preserving history Our Git repositories started out as parts of a single monster SVN repository where the individual projects each ha...

10 Sep at 14:42

MVC design pattern, service layer purpose?

MVC design pattern, service layer purpose? Let's say I have a following repo pattern : ``` interface IGenericRepo where T : class { IEnumerable GetAll(); T GetById(object id); void Insert(T obj)...

How to write Repository method for .ThenInclude in EF Core 2

How to write Repository method for .ThenInclude in EF Core 2 I'm trying to write a repository method for Entity Framework Core 2.0 that can handle returning child collections of properties using .Then...

Unit of work and the repository pattern

Unit of work and the repository pattern I have a repository pattern setup using NHibernate. The base class looks like this: ``` public interface IUnitOfWork : IDisposable { void Commit(); void Rol...

Repository Pattern Standardization of methods

Repository Pattern Standardization of methods All I am trying to find out the correct definition of the repository pattern. My original understanding was this (extremely dumbed down) - - I have really...

EF Including Other Entities (Generic Repository pattern)

EF Including Other Entities (Generic Repository pattern) I am using the Generic Repository pattern on top of Entity Framework Code First. Everything was working fine until I needed to include more ent...

Generic Repository or Specific Repository for each entity?

Generic Repository or Specific Repository for each entity? ## Background At the company I work for I have been ordered to update an old MVC app and implement a repository pattern for a SQL database. I...

How can I implement a transaction for my repositories with Entity Framework?

How can I implement a transaction for my repositories with Entity Framework? I am trying to utilize the repository design pattern in my application for 2 reasons 1. I like to de-couple my application ...

How To Define a JPA Repository Query with a Join

How To Define a JPA Repository Query with a Join I would like to make a Join query using Jpa repository with annotation @Query. I have two tables: and: The native query is:

8 Feb at 13:51

CentOS 8 - yum/dnf error: Failed to download metadata for repo

CentOS 8 - yum/dnf error: Failed to download metadata for repo On my CentOS 8 server, many `dnf` and `yum` commands fail with this error: > Failed to download metadata for repo This seems to apply onl...

9 Jun at 11:50

Updating records using a Repository Pattern with Entity Framework 6

Updating records using a Repository Pattern with Entity Framework 6 I'm writing a simple blog application and trying to establish CRUD operations in my generic repository pattern but I'm getting an er...

Services and Repositories in DDD (C#)

Services and Repositories in DDD (C#) How do `Services` and `Repositories` relate to each other in DDD? I mean, I've been reading up on DDD for the past 2 days and everywhere I go, there's always a `S...

What is the difference between the Data Mapper, Table Data Gateway (Gateway), Data Access Object (DAO) and Repository patterns?

What is the difference between the Data Mapper, Table Data Gateway (Gateway), Data Access Object (DAO) and Repository patterns? I'm trying to brush up on my design pattern skills, and I'm curious what...

How to use Simple injector, Repository and Context - code first

How to use Simple injector, Repository and Context - code first I'm trying to use Simple Injector to create my repository and use it in the Business logic layer ( also i want to use PerWebRequest meth...

Why is it not a commit and a branch cannot be created from it?

Why is it not a commit and a branch cannot be created from it? I need to work with an intricate configuration of repositories. I have 5 of them: 1. A remote central repository on machine 1. 2. My loca...

16 Oct at 11:52

Moving a folder from one SVN repository to another

Moving a folder from one SVN repository to another I have a set of repositories with a structure similar to the following: ``` /Source /branches /tags /trunk /FolderP /FolderQ /FolderR /Targe...

23 May at 12:1

Dependency Injection with Massive ORM: dynamic trouble

Dependency Injection with Massive ORM: dynamic trouble I've started working on an MVC 3 project that needs data from an enormous existing database. (thanks to [Steven](https://stackoverflow.com/users/...

Which is better? Have complicated search logic in repository or in a domain level service (via IQueryable or other)?

Which is better? Have complicated search logic in repository or in a domain level service (via IQueryable or other)? I need to be able to search customer accounts by multiple search fields. Right now,...

Unit of Work + Repository Pattern: The Fall of the Business Transaction Concept

Unit of Work + Repository Pattern: The Fall of the Business Transaction Concept Combining `Unit of Work` and `Repository Pattern` is something used fairly widely nowadays. As Martin Fowler [says](http...

Repository pattern: Implementation and lazy loading of model relationships

Repository pattern: Implementation and lazy loading of model relationships I have an application which deals with products and product categories. For each of these I have models defined using POCO. `...

Repository and Unit of Work patterns - How to save changes

Repository and Unit of Work patterns - How to save changes I'm struggling to understand the relationship between the Repository and Unit of Work patterns despite this kind of question being asked so m...

10 Jan at 17:6

MVC ViewModels and Entity Framework queries

MVC ViewModels and Entity Framework queries I am new to both MVC and Entity Framework and I have a question about the right/preferred way to do this. I have sort of been following the Nerd Dinner MVC ...

Async/Await in multi-layer C# applications

Async/Await in multi-layer C# applications I have a multi-layered C# MVC4 web application in a high-traffic scenario that uses dependency injection for various repositories. This is very useful becaus...

ASP.NET Identity with Repository and Unit of Work

ASP.NET Identity with Repository and Unit of Work I'm learning Repository and Unit of Work patterns in ASP.NET MVC 5 application with Entity Framework 6. I had already read a lot of tutorials and arti...

Repository pattern implementation with data model in a tree structure

Repository pattern implementation with data model in a tree structure I have two data collections in two different models that implement a repository interface. One of them is in a flat list which fit...

19 Dec at 18:59

How to use the repository pattern correctly?

How to use the repository pattern correctly? I am wondering how should I be grouping my repositories? Like from the examples I seen on the asp.net mvc and in my books they basically use one repository...

Service Layers and Repositories

Service Layers and Repositories I've been using MVC frameworks for a short while now and I really like how the concerns are separated out. I've got into a bad habit of letting the controllers do quite...

Should write complex query in Repository or Service layer?

Should write complex query in Repository or Service layer? I are planning migrate our data access layer to using repository pattern and unit of work. I do know repository will help me to change persis...

Best way to implement Repository Pattern?

Best way to implement Repository Pattern? I've been exploring BDD/DDD and as a consequence trying to come up with a proper implementation of the Repository pattern. So far, it's been hard to find a co...

How to fake DbContext.Entry method in Entity Framework with repository pattern

How to fake DbContext.Entry method in Entity Framework with repository pattern Because I want to unit test my code I have implemented the repository pattern in my MVC4 application. I managed to make a...

How do I correctly use Unity to pass a ConnectionString to my repository classes?

How do I correctly use Unity to pass a ConnectionString to my repository classes? I've literally just started using the Unity Application Blocks Dependency Injection library from Microsoft, and I've c...

Invalid Argument in Method when pulling from repository

Invalid Argument in Method when pulling from repository I am trying to learn how this Repository works by disecting it. I am really lost so was hoping the community would help me out a bit. Please kee...

How does a service layer fit into my repository implementation?

How does a service layer fit into my repository implementation? I have created a POCO model class and a repository class which handles persistence. Since the POCO cannot access the repository, there a...

Unit test an Entity Framework generic repository using Moq

Unit test an Entity Framework generic repository using Moq I am not able to get a passing test because the class `this.dbSet = context.Set();` is always `null`. As you can see in the code below, I hav...

How to implement Generic Repository Design Pattern with Dapper?

How to implement Generic Repository Design Pattern with Dapper? I am using Dapper for a MicroORM to retrieve and Save Data to SQL Server 2014. I have got DTO classes in a DTO Proj that represent the D...

Entity Framework Generic Repository Error

Entity Framework Generic Repository Error I am trying to create a very generic generics repository for my Entity Framework repository that has the basic CRUD statements and uses an Interface. I have h...

Transition from Entityspaces(Tiraggo) into Servicestack Ormlite

Transition from Entityspaces(Tiraggo) into Servicestack Ormlite at this moment we are migrating from Entityspaces(Tiraggo) into Servicestack Ormlite. One point is the way to open and close the DBConne...

Using View-Models with Repository pattern

Using View-Models with Repository pattern I'm using [Domain driven N-layered application architecture](http://blogs.msdn.com/b/marblogging/archive/2011/05/23/domain-drive-design-n-layered-net-4-0-arch...

How to unit test a repository pattern that uses Entity Framework?

How to unit test a repository pattern that uses Entity Framework? I'm currently trying to unit test a repository I made through Entity Framework: What I want to happen is that test the repository with...

DDD - How to implement high-performing repositories for searching

DDD - How to implement high-performing repositories for searching I have a question regarding DDD and the repository pattern. Say I have a Customer repository for the Customer aggregate root. The Get ...

Trying to simplify our repository pattern

Trying to simplify our repository pattern Currently we have implemented a repository pattern at work. All our repositories sit behind their own interfaces and are mapped via Ninject. Our project is qu...

Onion Architecture, Unit of Work and a generic Repository pattern

Onion Architecture, Unit of Work and a generic Repository pattern This is the first time I am implementing a more domain-driven design approach. I have decided to try the [Onion Architecture](http://j...

Using Simple Injector with Unit Of Work & Repository Pattern in Windows Form

Using Simple Injector with Unit Of Work & Repository Pattern in Windows Form I'm trying to implement IoC in my windows form application. My choice fell on Simple Injector, because it's fast and lightw...

Persistance ID's and Domain Model Entities

Persistance ID's and Domain Model Entities I was curious on what peoples thoughts are on keeping the Id of a DAL entity as a property of the Domain Entity, at the absolute most a read-only property. M...

Well designed query commands and/or specifications

Well designed query commands and/or specifications I've been searching for quite some time for a good solution to the problems presented by the typical Repository pattern (growing list of methods for ...

How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?

How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning? I tried to install a package, using but received the warning Why doesn't R think that the package is available? S...

Repository and Data Mapper pattern

Repository and Data Mapper pattern After a lots of read about Repository and Data Mapper I decided to implement those patterns in a test project. Since I'm new to these I'd like to get your views abou...