Click here to Skip to main content
15,867,999 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 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)
by Mark Pelf
Tutorial on EF7 – Database First approach using GUI tools EFCorePowerTools

All Articles

Sort by Score

Entity Framework 

18 Jan 2017 by Jovan Popovic(MSFT)
Mapping properties in EF model to database columns that contain JSON
5 Dec 2022 by Kenji Elzerman
Fundamentals of Entity Framework
9 Oct 2018 by Akhil Mittal
Entity framework core, code first migrations and data annotations in EF Core
4 Apr 2015 by Jean Carlo S. Passos
CRUD over Association Entity that maps to association tables
12 Jan 2022 by Dan Letecky
Use ASP.NET Core, Entity Framework, DayPilot and vanilla JavaScript to build a web application for doctor appointment scheduling.
27 Mar 2014 by Shenwei Liu
An article with sample application showing how and what we can do to improve and enhance a WCF and EF data access web service
18 Jul 2014 by Matthew Givens
How to change databases at run-time in a user-friendly manner.
15 May 2017 by Charles d'Avernas
A ready-to-use solution for dynamically querying an Entity Framework DbContext in ASP.NET
17 Apr 2012 by Nadege Rouelle
Shows how to configure Entity Framework Code First with Data Annotations and Code Fluent.
12 Feb 2011 by Sandeepkumar Ramani
Parallelism in .NET – PLINQ
29 Mar 2016 by wells cheung
Angular Single-Page Application, MEF, Privilege Control, WCF Restful Service, ui-router,
12 May 2017 by DaveDavidson
In this article, I show LINQ to Entities syntax that will produce queries with CROSS APPLY and LEFT OUTER JOIN clauses.
7 Mar 2016 by Wonde Tadesse
You will need to implement a centralized role management and use across the applications. This article will be a starting point. Introducing Single Sign-on to an existing ASP.NET MVC application[^]
21 Feb 2018 by Yunus Emre Kalkan
How to create custom repostories in ASP.NET Boilerplate and use stored procedure, view, user defined functions inside your repository
15 Feb 2023 by Kenji Elzerman
Learn the basics of Entity Framework with the database-first approach
11 Jul 2014 by Sourav Kayal
This is the first article demonstrated inheritance in Entity Framework. In this article I have implemented the Table per Hierarchy approach.
5 Sep 2015 by Maxim Kurayan
EF Dynamic Report is a small open source project which allows you to use Entity Framework mapping between types and tables as a dynamic report data source
19 Aug 2017 by Afzaal Ahmad Zeeshan
.NET Core 2.0 brings a lot of improvements to the system, and it brings a lot of pain to the developers as well. I had a lot of problems upgrading .NET Core 1.x apps to .NET Core 2.0; I yet have to feel the promise it makes about performance and so, but let us see how to upgrade our existing applica
28 Jul 2010 by Ernesto Herrera
Integrate Reporting Services with your Silverlight Line-of-Business applications.
26 Nov 2013 by Sampath Lokuge
This blog post shows how to use enum with Entity Framework 5.
2 Jun 2015 by Gediminas Geigalas
I've been successfully using NHibernate as my first ORM for a few years. For the last year, I have decided to use Entity Framework instead. Here's what I liked and disliked.
31 Oct 2016 by SlavaUtesinov
EF implementation of BulkInsert operation and "Arrays in a Bind" solution at case of absence of EF.
20 Sep 2010 by NeCroFire
"EF automatically populates your business objects with the db-generated values after your call to SaveChanges()."Example://create a new Client objectClient c = new Client();c.Name = "Test";//save to dbcontext.AddToClients(c);context.SaveChanges();//EF will populate your...
10 Jun 2016 by Emiliano Musso
In this article, we will see how to use entity framework in our Applications, developed through the various languages that Visual Studio allows us to use. The examples in this article and probably in the next, will be C # used under WinForms, but - as mentioned - this choice is not going to affect a
23 Nov 2018 by Leonard E. James
Add Project and Project Skills Processing
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.
7 Dec 2016 by Kuv Patel
Convert a class library of POCO classes to datacontracts for use with WCF without having to write DataContract and DataMember attributes directly to the POCO classes.
20 Aug 2017 by Mohsen Esmailpour
Organizing Fluent configurations into separate classes in EF Core 1.0
29 Sep 2016 by Tanvir Ahmad Arjel
There are lots of ways to implement Uniqueness or Unique Key attribute on a model property other than primary key, but here I am going to discuss two possible best and easiest ways to do so in two parts of these series. This is Part 2.
6 Mar 2017 by Michael Doleman
A simple DAL with an integrated, lightweight model for database seeding from a JSON source, using the code-first method in Entity Framework.
13 Mar 2017 by defwebserver
You can create database driven .Net Core applications using JavaScriptServices, and PrimeNG.
12 Nov 2018 by Vlad Neculai Vizitiu
Application triggers for ASP.NET Core 2.1 Entity Framework Core
15 Mar 2011 by Not Active
Using SPMetal to generate Linq to SharePoint classes
13 Feb 2012 by Wonde Tadesse
As far as you are using the latest version for EF(4.0,4.1), there is no problem getting the last inserted entity object identity value. Note The identity column value will be returned only after the inserted statement committed successfully.1. Insert the Entity Object.2. Save the Entity...
11 Apr 2013 by MVukoje
Simple generic extension method that will attach detached POCO to DbContext without reloading it form DB
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
30 Mar 2018 by Milan Stanacev
How to use EF Core code-first approach when DB schemas are split into multiple projects and DB contexts.
12 Feb 2021 by O.Nasri
Steps to create a nice dashboard web page using .NET MVC Core
21 Apr 2010 by Mr Orange
Introduction...
21 Aug 2010 by Vinayaka Krishna Shenoy
Hi,Your approach looks ok, but while using the SaveChanges on top of ObjectContext instance, i would prefer you to use SaveChanges(false) than SaveChanges() - The reason behind that is if one of the operation inside the transaction results in error, then your context wont loose the...
22 Sep 2010 by Hossein Ghahvei Araghi
This article is about DSL and SQL Server Modeling
29 Dec 2011 by Weidong Shen
This article describes the IClientChangeTracking interface generated by Self-Tracking Entity Generator for WPF/Silverlight.
31 Aug 2012 by Prasad_Kulkarni
Have a look:Solution to Error 175 The specified store provider cannot be found in the configuration or is not valid[^]
18 Sep 2012 by Sergey Alexandrovich Kryukov
Please see my comment to the question. Your question might be based on some your misconception or maybe the conception you do not explain.The relationships should not really be quantified by the total number of them or something like that. And "a lot of relations" does not have to mean "a...
11 Jan 2013 by Sergey Alexandrovich Kryukov
If my eyes do not betray me, I am sure you do not present the situation correctly. The code variants are functionally fully equivalent, but this is not even the main point. The point is: the code line you commented cannot throw an exception in principle.What happens can be a completely...
15 Feb 2013 by demouser743
I would like to share the application which is done in MVC4 using Entity Framework.
12 Jan 2014 by db7uk
After reviewing the code pes1957 sent to me I was able to determine that there was indeed an assembly reference error.Basically the number of projects that were in the solution had a mixture of version 5 and 6 Entity Framework references. I updated the references, and web.config to show the...
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
24 Oct 2016 by PatrickJNolan
Configuration.EntityFramework is a custom configuration provider for the .NET Core Configuration system built on EntityFrameworkCore.
17 Nov 2018 by Mangesh_Gaherwar
Article with Angular 7 and Entity Framework core and .net Core
18 Oct 2020 by JawadHasan
Use NoSQL database functionality from within a Relational database system
15 Jan 2021 by DotNetLead.com
How to implement paging and sorting to yield good performance
17 Dec 2022 by Kenji Elzerman
Let's take a look at the very fundamentals of LINQ and how to use it.
5 Dec 2010 by Gil Fink
How to Separate Self-Tracking Entities to Their Own Class Library
12 Dec 2010 by Gil Fink
EF Feature CTP5: Inheritance Scenarios with Code First Fluent API
7 Mar 2013 by Weidong Shen
This article describes the IClientChangeTracking interface generated by Self-Tracking Entity Generator and Visual Studio 2012.
12 Dec 2012 by Sheikh Muhammad Haris
Go through the following link. It is a very basic tutorial for absolute beginners for MVC 3 with DB first approach. http://msdn.microsoft.com/en-gb/data/gg685489Hope this helps you.
11 Apr 2014 by Pheonyx
Hi guys,I am having an issue with Entity Framework and object inheritance.Object Concept:Base class - MarketDerived Classes - SingleMarket / CombinedMarketBoth of the SingleMarket and CombinedMarket should be based on the Market Class. However I only have one "Market" table in...
28 Jul 2014 by Shmuel Zang
See this CP article: LinQ Extended Joins[^].
17 Oct 2014 by m-shraddha
public object SearchInfo(DateTime duedate, int customerid, int billtypeid, int providerid, string cityname, string areaname, string buildingname){try{context = new MGLEntities();var query = from cb in context.tbl_CustomerBillsjoin c in context.tbl_Customer on cb.CustomerID equals...
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.
20 Dec 2014 by Roger C Moore
A guide to constructing an application using Expression Blend and Silverlight for the front-end which obtains data from a WCF service and SQL Server back-end
21 Nov 2015 by KK Kod
Designing and Development of a simple ASP.NET Web API.
19 Apr 2016 by Sacha Barber
Entity framework 7 in memory provider test
9 May 2016 by Kornfeld Eliyahu Peter
Your code - over-simplified:[WebMethod]public static string jqufunc(int year){ foreach (var pr in allprogs) { return res + "*" + res2; }}You can see that this code will return anything only if allprogs has at least one member - and that's not promised...
14 May 2017 by Dave Kreskowiak
A simple Google search goes a long way. I found this in 5 seconds: Raw SQL Query in Entity Framework[^].
23 Aug 2017 by OriginalGriff
You added it to the class, but you don't appear to have a matching column in your database. As a result, SQL cannot handle any requests you make to that column. Add the column to the DB...
5 Jan 2018 by #realJSOP
When you have a customized DbContext constructor.
31 Jan 2018 by Pawel idzikowski
How to replace the web API request query string to provide case insensitive OData search
8 Mar 2018 by F-ES Sitecore
It could be because you're reading it twice. Try this while (sdr.Read()) { string name = sdr["prod_name_pharma_form"].ToString(); products.Add(new SelectListItem { Value = name, Text = name }); }
13 Mar 2018 by Richard Deeming
It would almost certainly be more efficient to retrieve the list of country names in a single query, and to only save the changes after adding all of the offers to the context: var countries = db.COUNTRIES .Where(e => countryId.Contains(e.alfa1)) .Select(e => e.countryName) ...
11 Jun 2018 by Maciej Los
If i understand you well, you don't know how the get sum of Qnty field in stock table... This is the way: var result = dbcontext.stock .GroupBy(x=>x.itemID) .Select(grp=>new { itemID = grp.Key, Count = grp.Sum(x=>x.Qnty) }) .ToList(); The rest of job...
14 Jul 2019 by Viswanatha Swamy
In this article, we will be looking at how to use SQL Server 2017 Docker image for Local Web API development.
26 Nov 2022 by Rudi Breedenraedt
How to share a transaction across multiple Entity Framework contexts
6 Jun 2023 by Mark Pelf
Fix for adding new DB tables does not work in VS 2022, ver. 17.6.2, EF6 (Classic)
7 Sep 2019 by Lee P Richardson
This blog post lists 3 days to refactor EF Linq queries without killing Perf
21 Dec 2023 by Richard Deeming
You are performing an INNER JOIN - you will only get back results from the Addresses table which have a corresponding record in the ExtraData table. If you want all records from the Addresses table, even if they have no corresponding record in...
18 Jul 2010 by Gil Fink
One question that I received yesterday after I published the Revisiting the Repository  and Unit of Work Patterns with Entity Framework post was how to include the eager loading ability of Entity Framework. This post is offering a solution.R
11 Dec 2010 by Gil Fink
Using EF DbContext with WCF Data Services
13 Dec 2010 by Not Active
To get only some columns you need to create a projectionvar list = from s in db.Lists select s.column1, s.column2
23 Aug 2011 by Sunasara Imdadhusen
Hi,I have created one edmx file which contains database Tables and Stored Procedure. Now my requirement is i would like to generate database script using "Generate Database from Model" but it will provide only Tables script not Stored Procedure.So how can i generate script for Stored...
26 Dec 2011 by AnnieMacD
Assuming your EDM is dbentity:using (var myContext = new dbentity()){ var person = new Person(); // add some stuff here to populate myContext.Person.AddObject(person); myContext.SaveChanges();}If 'person' is an object in the entity model, that's all that's required to...
31 Dec 2011 by RaviRanjanKr
Try ADO.NET Entity Framework and .NET 4 - How to use Visual Studio 2010 Modeling Tools to Build a Database[^]
21 Jan 2012 by Weidong Shen
This article describes how to do data validation with Self-Tracking Entity Generator for WPF/Silverlight.
14 Jan 2012 by Henry He
In this article, I will explain what transparent lazy loading is and how it's implemented in NHibernate and Entity Framework.
9 Feb 2012 by Christian Graus
It's LINQ you are using. use DateTime.Now to get the current date, and then compare it from there. Do you know how to write LINQ queries ?
17 Apr 2012 by Nadege Rouelle
Let's see how to define our own database name using Entity Framework Code First
7 Nov 2012 by Aydin Khatamneajd
Using ModelMetadataProvider to Set Display Name Metadata for the Model Fields at Runtime
20 Jun 2013 by BobJanova
I'm not a WPF expert so I can't give you working code, however I can tell you the approach to use here.The view for a set of results should be a ListView, with the ItemTemplate set to whatever you want the display for an individual Vinyl to be (probably a panel of some kind with some text...