Click here to Skip to main content
15,880,392 members
Everything / Entity Framework

Entity Framework

entity-framework

Great Reads

by Jovan Popovic(MSFT)
Mapping properties in EF model to database columns that contain JSON
by Kenji Elzerman
Fundamentals of Entity Framework
by Akhil Mittal
Entity framework core, code first migrations and data annotations in EF Core
by Jean Carlo S. Passos
CRUD over Association Entity that maps to association tables

Latest Articles

by GabrieleTronchin
In this project, I've implemented the Transactional Outbox Pattern using EF Core.
by David_Cui
To introduce a free library to save some tedious work for writing mapping code between entities and DTOs
by Mark Pelf
Fix for adding new DB tables does not work in VS 2022, ver. 17.6.2, EF6 (Classic)
by Mark Pelf
Tutorial on EF7 – Code First approach using Command Line (CLI)

All Articles

Sort by Score

Entity Framework 

4 Apr 2015 by Jean Carlo S. Passos
CRUD over Association Entity that maps to association tables
18 Jul 2014 by Matthew Givens
How to change databases at run-time in a user-friendly manner.
14 Apr 2014 by Maninder Singh Puhi
Appropriate query to fetch required no of results from DB instead of getting all at on time for binding controls like Gridview, listview etc
31 Oct 2015 by Richard Silveira
EntityFramework.MoqHelper library to work with Entity Framework 6 and Moq libraries doing mocks of Entity Framework main methods that access database.
20 Aug 2017 by Mohsen Esmailpour
Organizing Fluent configurations into separate classes in EF Core 1.0
29 May 2014 by Randy Kroeger
Created a POC that dynamically builds a predicate using Expression and Reflection.
12 Oct 2014 by Dukhabandhu Sahoo
Know how to exclude types from the Model in Entity Framework Code First
13 Nov 2015 by OrlandoCurioso
An EF base DbContext that provides detailed information on current and totalized changes
29 Nov 2015 by Michael Bogaerts
What brings the 15.2 release for XAF (win) developers
18 Nov 2017 by Norman Paterson
Performance issue using ROW_NUMBER() OVER in a database view for the PK
21 Apr 2010 by Mr Orange
Introduction...
30 Jul 2014 by DiponRoy
How to handle database scheme changes with normal SQL scripts, without migration in Entity Framework code first
23 Jan 2016 by Igor_A
An architectural prototype of a business logic server as Windows Service. Sample service implementation and test utility.
22 Jul 2016 by Abhay@Accenture
Performance tuning using SqlBulkCopy
10 Nov 2014 by Valentino_Lokesh
Migrations enabled in Class Library (Data Access Layer) and the same is referenced to MVC ProjectNo need to maintain the Data Access and Model classes in the MVC Project. We can have separate Class library for Model and Data Access and have migrations enabled in Data Access where DbContext resides.
5 Jan 2018 by #realJSOP
When you have a customized DbContext constructor.
6 Jun 2023 by Mark Pelf
Fix for adding new DB tables does not work in VS 2022, ver. 17.6.2, EF6 (Classic)
17 Apr 2012 by Nadege Rouelle
Let's see how to define our own database name using Entity Framework Code First
10 Aug 2016 by Nathan Minier
Generic AddOrUpdate for EF with composite key support
8 Sep 2017 by Brady Kelly
How to improve the naming and change the naming and schema of all the Identity tables like AspNetUsers
11 Sep 2017 by Alen Toma
Entity Framework Dynamic include hierarchy
8 Oct 2019 by Ger Hayden
These notes are based on my experience getting started with IdentityServer4.
1 Nov 2011 by Daniel Lo Nigro
As far as I know, the "UpdateModel" method is designed to do this. Something like this should work, but I haven't tested it:public ActionResult Edit(Entity entity){ var entityInDbSet = _context.Set.SingleOrDefault(x => x.Id == entity.Id); UpdateModel(entityInDbSet); ...
17 Dec 2012 by santosh poojari
This is most general collection operation that we come across daily. Its set based operation using LINQ Except Operator.
19 Mar 2013 by Nejimon CR
A simple possible solution to Entity Framework Code First Navigation Property/Related Records not being loaded automatically
12 Jun 2014 by Super Lloyd
The title says it all! Make an outer join in 1 LINQ statement
25 Feb 2018 by GuyThiebaut
Solving the "Store update, insert, or delete statement affected an unexpected number of rows (0)" response.
1 Dec 2021 by Uladzislau Baryshchyk
Application that can be used to work with subd and connecting Amazon RDS to the project
24 Oct 2011 by George Danila
An Extension Method that might help you copy over the values from one object to another, provided they are of the same type.
4 Feb 2013 by retsnoM
Sample code showing how to implement IDbContextFactory for retrieving ConnectionString at runtime and trigger automatic migrations. For use with DI and IoC or if you have different databases with the same model.
9 Jun 2013 by mkader
Dynamics CRM 2011 and BizTalk 2010 Server Integration - Retrieve Multiple Dynamics CRM 2011 Entity Records from BizTalk 2010 Server
14 Jun 2020 by DiponRoy
Upgrade a legacy ASP.NET project to use managed Oracle.ManagedDataAccess.Client instead of unmanaged Oracle.DataAccess.Client while using Entity Framework DB first or EDMX.
10 Mar 2022 by Master DJon
New MigrationSqlGenerator to generate SQL from MigrationOperations having attribute "ExecuteAfter" or "ExecuteBefore"
28 Sep 2014 by Bhushan Mulmule
This is terribly unorganized document with mix of MVC, Entity Framework, LINQ, HTML 5 and JQuery how tos...
24 Feb 2016 by Lộc Nguyễn
On Chinook digital media store sample database
7 Apr 2021 by mark_worrall
How to move Entity Framework Core v5.0 into a separate Visual Studio Project
16 May 2014 by Ahmad F Hassan
An easy way to view hierarchical data in a simple ASP .NET Repeater
11 Nov 2013 by sathya88
A simple framework for data validation using data annotations at entity level.
8 Feb 2017 by Arun Chandrasekhara Pillai
Generic JqGrid implementation in MVC with custom filtering and dynamic sorting
11 Feb 2014 by Tony Sherlock
Snippet for Left Outer Join, Entity Framework
8 Feb 2012 by Harry von Borstel
Extension Method for exceptions that give a useful text even on Entity Framework Exceptions
13 Oct 2016 by MaDOnos
Adapter implemantation to mock DbContext easily
9 Nov 2015 by ChristineBoersen
A technique to return dynamic data from a SQL Query using Entity Framework 7
5 Nov 2015 by Md. Mainul Islam
This tip will show the ways to incorporate Entity Framework in .NET applications.
22 Oct 2023 by David_Cui
To introduce a free library to save some tedious work for writing mapping code between entities and DTOs
7 Jan 2012 by Massimiliano Peluso "WeDev Limited"
Repository Pattern with Entity Framework 4.1 and Code First
15 Jul 2015 by Member 10295860
Using stored procedure type for binding data to dataset in SSRS or adding entity to Entity data model
20 Nov 2014 by Avinash Narnaware
How to create Pivot Table in SQL Server 2008 R2 and in C# Linq to Entity Framework in a step by step manner with two different instances.
3 Oct 2018 by Alen Toma
EntityWorker.Core - an alternative to entity Framework
29 Jan 2015 by Mina Talaat Ghaly
Add the auditing properties with one SQL query and fill them from one place.
3 Sep 2014 by Dukhabandhu Sahoo
The use of different Database initializer options in Entity Framework Code First
20 Apr 2011 by jonx
Very good stuff. Learned me a lot about how to access to the physical structure of the query.There is also a CopyToDataTable : http://msdn.microsoft.com/en-us/library/bb386921.aspx[^]And for the record here is a C# version:protected DataTable EntityToDatatable(IQueryable Result,...
14 Feb 2019 by DiponRoy
A utility class to send parameters for IN() operator in SQL using parameterized queries
13 Oct 2014 by SRS(The Coder)
This tip gives an explanation with example on how to get output parameter value from stored procedure using Entity Framework in ASP.Net
7 Dec 2015 by Efe Erdoğru
An alternate method for multi db provider support for entity framework
24 Oct 2014 by Pharylon
Connection Resiliency with EF 6
7 Nov 2016 by Wahid Bitar
Validated the unique constraints at dbContext ValidateEntity in a generic way by reading the IndexAttribute values.
24 Apr 2014 by Bankey Sharma
Converting DataReader Result into List of Objects Using Generic Type, Property Attribute and Reflection
18 Apr 2018 by Fiyaz Hasan
This article shows you how to work with database triggers in entity framework core using a third party library.
6 Apr 2018 by CyberMakarov007
SQL table dependency with entity framework in WPF
6 Mar 2015 by Alexandre Paula
aspnet Membership Login in any project you want.
14 Oct 2014 by Dukhabandhu Sahoo
Learn how property is automatically mapped to column and how to manage it in entity framework code first.
6 May 2015 by Mostafa Asaduzzaman
How to migrate database in Entity Framework 7 and Visual Studio 2015
4 Jun 2017 by Puresharper
Lazy loading is a nice feature but sometimes it is more efficient to eager fetch. However entity framework does not provide an easy way to do it.
28 Dec 2021 by DiponRoy
Delete all the records from the table using EF
12 Oct 2016 by MaDOnos
How to mock EF DbContext and DbContextTransaction with Proxy
7 Dec 2015 by Igor_A
Review of an approach of increase clustered server performance. Library sample and test utility.
19 Aug 2018 by Islam Refaei
How to create contained DB users to be used among your application
3 Mar 2018 by Ajit Hegde
This tip describes how to use ASP.NET identity entity framework with mysql database.
4 Feb 2012 by Harry von Borstel
How to get an Entity Framework object - either from ObjectContext, from database or from scratch
26 May 2011 by Soulus83
Unique constraints
24 Feb 2010 by RobertFall
I was struggling recently with a problem I KNEW had to be solvable in a much easier way than replacing ALL the fields in my managed entity by hand and then saving it. I wanted a way that I could simply replace the managed entity with a new one that had been created from an XML document.Turns...
22 Mar 2017 by Fiyaz Hasan
Know how to use Entity Framework's new shadow property feature for easily implementing common audit fields for entities
19 May 2019 by DiponRoy
The aim of this helper class is to divide a large IEnumerable into multiple small list.
22 Feb 2019 by Bohdan Stupak
Here’s a workaround how to fix exception "DbContext has been disposed"
7 Aug 2022 by DiponRoy
EF Core first publishing multiple DB contexts in same DB
1 Jun 2017 by Sherjil_Ahmed
Mixing DB-First and Code First Approach for using SPs in EF-Way
4 May 2010 by dswersky
If you have Visual Studio 2010 Ultimate, you have some serious architectural tools. One of my favorites (so far) is the Dependency Graph.Select Architecture-Generate Dependency Graph and you'll see that you can generate a graph by Assembly, Namespace, Class, or Custom. Try the Assembly...
26 Dec 2009 by Vinayaka Krishna Shenoy
From past few days i was doing some R & D on the upcoming Entity framework from Microsoft, and i found it was interesting in many ways,The first part which i liked the most is -Querying to the Entity Data Model(EDM) rather than the real data store.At a high level , we have plenty of...
23 Sep 2015 by Ponkarthikeyan Thangavel
This article decries optimizing entity framework performance when using Code First approach with lazy loading enabled
31 Dec 2009 by Vinayaka Krishna Shenoy
I explored a bit more on Entity framework,during last week of 2009 and here goes my observations on how to extend the Entity Framework functionality if you want to customize the normal/ideal flow of Entity framework execution engine.1) OnContextCreatedBy default a declaration of this...