tagged [entity-framework-6]

How entity framework works for large number of records?

How entity framework works for large number of records? I see already a un-answered question [here on](https://stackoverflow.com/questions/14205033/entity-dealing-with-large-number-of-records-35-mlns)...

Single transaction over multiple contexts in Entity Framework 6

Single transaction over multiple contexts in Entity Framework 6 We have a scenario to save two entities from two contexts in single transaction. Step 1 - SetTransaction(firstContext, true); Step 2 - S...

14 Aug at 12:0

Merging migration entries in Entity Framework

Merging migration entries in Entity Framework I have an Entity Framework 6 CF project that has a few migrations already in place. The model is now stable and there is no need to keep the migration his...

Creating Unique Index with Entity Framework 6.1 fluent API

Creating Unique Index with Entity Framework 6.1 fluent API I have a column "Name" that must be unqiue. No foreign key or anything like that. EF 6.1 finally supports creating such indexes via Annotatio...

What to use instead DbEntityValidationException in EF Core?

What to use instead DbEntityValidationException in EF Core? With EF I used DbEntityValidationException catch branch (along with others) Now using .NET Core 3.17 with EF Core 3.17 and apparently there ...

How to disable model caching in Entity Framework 6 (Code First approach)

How to disable model caching in Entity Framework 6 (Code First approach) Following [MSDN documentation](https://msdn.microsoft.com/en-us/library/system.data.entity.dbcontext.onmodelcreating%28v=vs.113...

Is there a non-commercial alternative to Z.EntityFramework.Extensions?

Is there a non-commercial alternative to Z.EntityFramework.Extensions? Entity Framework can be very slow on mass insert/update/delete operations. Even the often suggested tweaks to turn off AutoDetect...

Possible to set column ordering in Entity Framework

Possible to set column ordering in Entity Framework Is there any possible configuration to set database column ordering in entity framework code first approach..? All of my entity set should have some...

Adding Inner Join to DbScanExpression in Entity Framework Interceptor

Adding Inner Join to DbScanExpression in Entity Framework Interceptor I'm trying to use an Entity Framework CommandTree interceptor to add a filter to every query via a DbContext. For the sake of simp...

Why does this EF insert with IDENTITY_INSERT not work?

Why does this EF insert with IDENTITY_INSERT not work? This is the query: When executed, the `Id` of the inserted record, on a new table, is still 1. W

store only date in database not time portion C#

store only date in database not time portion C# I have a test class and an `ExecutionDate` property which stores only date but when we use `[DataType(DataType.Date)]` that also stores the time portion...

EntityFramework 6 How to get identity-field with reflection?

EntityFramework 6 How to get identity-field with reflection? I have a generic method with type parameter T, where T is the type of entity in EF model. I need to get the name of identifying field in th...

How to Use Entity Framework 6.x in Asp.Net 5 (MVC 6)

How to Use Entity Framework 6.x in Asp.Net 5 (MVC 6) I'm testing out the new Asp.Net 5, using VS 2015 CTP-6. Because of the lack of features in Entity Framework 7, I would prefer using EF6 for now. I'...

The Include path expression must refer to a navigation property defined on the type.in eager loading

The Include path expression must refer to a navigation property defined on the type.in eager loading I try to include anonymous type like this : I want all `incomelist` attributes in addition to `Comp...

Can't find System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer

Can't find System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer I'm constructing a DbContext from an SqlConnection. When I use it, I receive the following error: > The Entity Fr...

13 Jan at 12:33

Save detached entity in Entity Framework 6

Save detached entity in Entity Framework 6 I've read through LOTS of posts on saving a detached entity in Entity Framework. All of them seem to apply to older versions of Entity Framework. They refere...

How to retrieve Entity Configuration from Fluent Api

How to retrieve Entity Configuration from Fluent Api Using Entity-Framework 6 I'm able to set up the configuration through Fluent Api like this: [this question](https://stackov

How can set a default value constraint with Entity Framework 6 Code First?

How can set a default value constraint with Entity Framework 6 Code First? In a legacy app, most string properties can't be null and need to have a default value of string.empty. I know it's possible ...

Entity framework update one column by increasing the current value by one without select

Entity framework update one column by increasing the current value by one without select What I want to achieve is the simple sql query: Is there a way to make it happen without loading all records (t...

Manually add a migration?

Manually add a migration? I've been using Entity framework code first in a project and all the tables have been created /modified a while ago. Now I need to add an unique constraint to a table. I want...

Is it correct if i am using await + ToListAsync() over IQueryable which is not defined as a task

Is it correct if i am using await + ToListAsync() over IQueryable which is not defined as a task I am using asp.net MVC-5 with EF-6, and I am not sure if using await + `ToListAsync` is valid. For exam...

LINQ to Entities does not recognize the method 'System.Object GetValue(...)'

LINQ to Entities does not recognize the method 'System.Object GetValue(...)' My issue is I need to query on the value of a property in a generic class. The property is tagged with an attribute. See th...

19 Sep at 12:59

How to get original Entity from ChangeTracker

How to get original Entity from ChangeTracker Is there a way to get the original Entity itself from the `ChangeTracker` (rather than just the original values)? If the `State` is `Modified`, then I sup...

Prevent Entity Framework adding ORDER BY when using Include

Prevent Entity Framework adding ORDER BY when using Include We have a query similar to the following: The problem is that when adding `.Include(x => x.Children)`, the `ORDER

Multiple .Where() clauses on an Entity Framework Queryable

Multiple .Where() clauses on an Entity Framework Queryable I am trying to implement a complex filter using Entity Framework: I want to add `where` clauses to the queryable object based on my provided ...