zzz projects Entity Framework 6 EF 6
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

20 results for: in tag: repository

How To Properly Unit-Test CRUD Operations on a Repository?

Realize this may sound like a broad question - so let me clarify. I have a Repository exposed via an interface, with two concrete implementations - a ...MockRepository... and a ...EntityFrameworkRepository.......Now, i have a Unit-Test project for which a...
c# crud entity-framework repository unit-testing
asked by RPM1984

Repository pattern with Entity framework

Repository pattern is used to abstract from particular database and object-relation-mapping technology(like EF) used. So I can easily replace (for example) my Entity framework mappings with Linq to SQL in the future if I decide to do so....But when I use ...
.net asp.net-mvc entity-framework repository repository-pattern
asked by Rasto

Update method for generic Entity framework repository

I have a repository like that:...public class Repository<T> : IRepository<T> where T : class { private readonly IRepositoryContext _repositoryContext; public Repository(IRepositoryContext repositoryContext) { _repositoryContext = rep...
entity-framework repository
asked by iLemming

Fake DbContext of Entity Framework 4.1 to Test my repositories

I'm have a Base Repository and all Entities repositories inherits from that....In my testes i create a Fake DbContext and Fake DbSet to test my repositories, but when implementing some methods in my FakeDbContext I'm not able to implement the ...IDbContex...
.net c# entity-framework repository unit-testing
asked by Acaz Souza

Entity Framework - How to implement a Repository, using a custom DbContext?

We are starting to develop a small framework in our company, to share code between different applications. For data access we are using EF4. We have a custom DbContext class and a generic Repository:...public class RMDbContext : DbContext { // .... } ...
c# dbcontext entity-framework repository
asked by Rui Jarimba

Entity Framework + Repository + Unit of Work

I'm thinking about starting a new project using EF 4 and going through some articles, I found some articles about EF with repository pattern and unit of work...( ...http://tdryan.blogspot.com/2011/03/another-entity-framework-4-repository_15.html... and ..
c# design-patterns entity-framework repository unit-of-work
asked by Darf Zon

Entity Framework Code-First: "The ObjectStateManager cannot track multiple objects with the same key."

I'm running into an issue with Entity Framework code-first in MVC3. I'm hitting this exception:...An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key....This is a...
asp.net-mvc-3 code-first dbcontext entity-framework repository
asked by Josh

Where to handle DB exceptions in Entity Framework and repository pattern

how would you design this scenario (using Entity Framework 4.1, Code First and repository pattern): the Visual Studio solution contains the following projects...Solution |-Web Application Project |-DAL Project |-Model Project ...So in the Model Project th...
entity-framework error-handling exception repository
asked by Savvas Sopiadis

No need to dispose DataContext/ObjectContext in EF?

Albahari writes in "c# 4.0 in a nutshell":...> Although DataContext/ObjectContext implement IDisposable, you can (in general) get away without disposing instances. Disposing forces the context’s connection to dispose—but this is usually unnecess...
entity-framework idisposable repository repository-pattern
asked by Volker von Einem

How-to inject the Entity Framework DbContext into the ConfigurationBasedRepository of SharpRepository

I really would like to use ...SharpRepository... together with ...Ninject..., but I do not understand how to configure Ninject to share the Entity Framework DbContext between the repositories....I am using Entity Framework version 5 and Ninject version 3....
c# entity-framework ninject repository sharp-repository
asked by Florian Wolters

Benefit of using Unit of Work and Repository Patterns with Entity Framework

According to ...MSDN..., ...DbContext... is defined as:...Represents a combination of the Unit-Of-Work and Repository patterns and enables you to query a database and group together changes that will then be written back to the store as a unit....Sinc...
.net asp.net-mvc entity-framework repository unit-of-work
asked by Usman Khalid

Join multiple table using generic repository patten with Entity framework with unit of work

I am developing a web application using MVC4 with Entity framework 5....I have created generic repository for accessing database with unit of work. ...Having the below two repository,...CustomerRepository - Customer table...LibraryRepository - Library ...
entity-framework generics repository unit-of-work
asked by kannan Eswar

Using View-Models with Repository pattern

I'm using ...Domain driven N-layered application architecture... with ...EF code first... in my recent project, I defined my ...Repository... contracts, In ...Domain... layer. A basic contract to make other ...Repositories... less verbose:...public interf...
c# ef-code-first entity-framework repository viewmodel
asked by Masoud

Update entity graph Ids with Db generated Ids in Disconnected environment(EF)

I'm working with ...EF6 code first... in a ...WinForm... project. I used following method for reading entities from ...Db..., updating them and then save back them to ...Db...:...Read Entity graph using ...Linq to entities...(after reading the ...DbContex...
c# ef-code-first entity-framework graphdiff repository
asked by Masoud

Passing Context object between Repository, Generic repository & unit of work

I am working on an asp.net mvc web application & entity framework 6. i want to have these inside my application:-...Generic repository class....Dedicated repository class for each entity type. Where this dedicated repository will be derived from the gener...
asp.net-mvc entity-framework entity-framework-6 repository unit-of-work
asked by john Gu

OrderBy & OrderByDescending DateTime In Generic Repository?

In my Solution, create Generic Repository... public abstract class GenericRepository<C,T> : Repo.IGenericRepository<T> where T : class where C : DbContext, new(){ private C _entities = new C(); public C Context { ...
c# datetime entity-framework-6 repository
asked by jupeter

Entity Framework relationships between different DbContext and different schemas

So, I have two main objects, Member and Guild. One Member can own a Guild and one Guild can have multiple Members....I have the Members class in a separate DbContext and separate class library. I plan to reuse this class library in multiple projects and...
c# dbcontext entity-framework foreign-keys repository
asked by ScubaSteve

MVC design pattern, service layer purpose?

Let's say I have a following repo pattern :...interface IGenericRepo<T> where T : class { IEnumerable<T> GetAll(); T GetById(object id); void Insert(T obj); void Update(T obj); void Delete(T obj); void Save(); } interface IC...
asp.net-mvc c# design-patterns entity-framework repository
asked by warheat1990

Unit test enity framework generic repository using Moq

Structure:...DAL - entity framework, generic repository, unit of work ...BLL - service, automapper (mapping entity generated classes/objects to business objects) ...Interface - iservice ...Model - business objects Web - mvc ...Test - unit test...Generic ...
c# entity-framework moq repository unit-testing
asked by NKD

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...I like to de-couple my application from Entity in case I decide to not use Entity Framework at some point...I want to be able reuse the logic that interacts with the mo...
c# entity-framework repository repository-pattern transactions
asked by Junior

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now