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

Entity Framework 6 - Knowledge Base (KB)

76 results in tag: repository-pattern

Generic Repository Error in Entity Framework

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 hit a brick wall head first and been knocked over. Here is my code, written in a console applica...
c# entity-framework generics repository-pattern
asked by Jeff Ancel

Using Unity to create Entity Framework objects for the Unit of Work/Repository pattern

I'm trying to implement the Unit of Work/Repository pattern, as described here: ...http://blogs.msdn.com/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx...This requires each Repository to accept an IUnit...
.net c# entity-framework repository-pattern unit-of-work
asked by TobyEvans

Create POCO classes in a distinct project from the Entity Framework model project.

I'm trying to use the Repository Pattern with EF4 using VS2010....To this end I am using POCO code generation by right clicking on the entity model designer and clicking Add code generation item. I then select the POCO template and get my classes....What ...
.net code-generation entity-framework poco repository-pattern
asked by Max

Should I use the same context everywhere when using the Repository Pattern with Entity Framework 3.5 and MVVM?

I am developing a ...Database File System.... I am using - ....Net framework 3.5 ...Entity Framework 3.5...WPF with MVVM pattern...The project spans across multiple assemblies each using same model....One assembly,let's call it a "server", only adds data ...
c# entity-framework mvvm repository-pattern wpf
asked by Pale Blue Dot

A store expression cannot be turned into a method.

I saw this code work with LINQ to SQL but when I use Entity Framework, it throws this error:...LINQ to Entities does not recognize the method 'System.Linq.IQueryable'1[MyProject.Models.CommunityFeatures] GetCommunityFeatures()' method, and this method can...
c# entity-framework linq-to-entities repository-pattern
asked by Shawn Mclean

Entity Framework queries and MVC ViewModels

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 application for how I am writing this application. I have a page that has data from a few differe...
asp.net-mvc c# entity-framework repository-pattern viewmodel
asked by Dismissile

Entity framework and the repository pattern

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

With Moq, unit test the EF Repository pattern.

I decided to start writing unit tests in our application. It uses Entity Framework with a repository pattern....Now I want to start testing logic classes which are using the repositories. I provide a simple example here....Three of my methods in the class...
entity-framework moq repository-pattern unit-testing
asked by John

Please explain why you're using the Repository Pattern.

I am learning repository pattern and was reading ...Repository Pattern with Entity Framework 4.1 and Code First ... and ...Generic Repository Pattern - Entity Framework, ASP.NET MVC and Unit Testing Triangle ... about how they implement the repository pat...
c# entity-framework repository-pattern
asked by King Chan

How to utilize IUnitOfWork - best practices

I'm using EF4.3.1 in a .Net4.0 web forms (not MVC!) application....I tend to use the repository pattern with an IUnitOfWork interface. But I'm wondering if I'm following best practices, especially since most examples I've followed are based on MVC apps...
entity-framework repository-pattern unit-of-work
asked by raydenl

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

Multiple DbContext classes for a single web app. Good or bad?

Is it a good practice to have multiple ...XXX : DbContext... classes for each major section of a web application (considering it's a big one with at least 50 tables in its database)? For example: MembershipContext, BlogContext, StoreContext etc. Or it's m...
architecture coding-style entity-framework repository-pattern
asked by Grief Coder

Where to convert business model to view model?

In my ASP.NET MVC application, I am using unit of work and repository patterns for data access. ...Using the unit of work class and the repository defined inside it I am fetching the related set of entities in my controller. With my beginner knowledge, I ...
asp.net-mvc c# entity-framework repository-pattern unit-of-work
asked by emre nevayeshirazi

Implementing retry logic for deadlock exceptions

I've implemented a generic repository and was wondering if there is a smart way to implement a retry logic in case of a deadlock exception?...The approach should be the same for all repository methods. So is there anyway I can avoid writing 'try/catch - c...
c# database-deadlocks entity-framework repository-pattern try-catch
asked by user1638662

What specific issue does the repository pattern solve?

(Note: My question has very similar concerns as the person who asked ...this question... three months ago, but it was never answered.)...I recently started working with MVC3 + Entity Framework and I keep reading that the best practice is to use the reposi...
design-patterns domain-driven-design entity-framework repository-pattern
asked by Dave

NOT using repository pattern, use the ORM as is (EF)

I always used Repository pattern but for my latest project I wanted to see if I could perfect the use of it and my implementation of “Unit Of Work”. The more I started digging I started asking myself the question: ..."Do I really need it?"...Now this ...
aop architecture design-patterns entity-framework repository-pattern
asked by Dejan.S

A generic way to save an entity in Entity Framework

I am trying to write a GenericEFRepository which will be used by other Repositories. I have a Save method as below....public virtual void Save(T entity) // where T : class, IEntity, new() And IEntity enforces long Id { get; set; } { var entry = _dbCon...
c# entity-framework repository-pattern
asked by Mehmet AtaÅŸ

How to convert DTO to View Model and then back again?

I'm using MVC 4 with the repository pattern and unit testing also. I have a typical controller that has simple CRUD functionality. I've separated my View Models from my DTOs and I would like to know the best way to convert between the 2:...Models:...I hav...
asp.net-mvc asp.net-mvc-4 asp.net-mvc-viewmodel entity-framework repository-pattern
asked by Smithy

Is there a reason for using the Repository pattern with Entity Framework if I know I will only ever use EF?

From reading various books and articles, I seem to rather often find the usage of the Repository-pattern suggested. I get the point if you need to be able to swap out your data layer from one to another, but my question is, if I know with 100% certainty t...
entity-framework repository-pattern
asked by bobblez

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 without actually sending/connecting to the actual database, I want to this without using any mocking framework....Currently...
c# entity-framework repository-pattern unit-testing
asked by Randel Ramirez

Page 1 of 4
  • 1
  • 2
  • 3
  • 4
  • »

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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!