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...

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 ...

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 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 ...