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)

6940 results

Entity Framework 6 - Query Performance

I use Entity Framework 6 and i currently have a query with many includes which loads about 1200 entities into the dbContext. Loading the entities seems to be quite slow as the query takes almost a minute. Is there anything I can do about the performance? ...
c# dbcontext entity-framework-6
asked by CrazyEight

How to update(by merging) edmx without override the model classes in asp.net mvc

I am developing an application in asp.net mvc. I use entity framework as ORM. I have a problem. To use javascript unobstrusive validation, I need to add annotation to model objects. For example; [Required], [EMailAddress]. But when we add something to the...
asp.net-mvc c# entity-framework entity-framework-6 orm
asked by user6172721

Does IQueryable re-query the database on every access of the object?

I had a bug in my code and eventually managed to track it down to my usage of an IQueryable statement, however the implication of what happened leaves me with a few questions I was hoping someone with more knowledge on Entity Framework could shed some lig...
.net c# entity-framework-6
asked by DAustin

How do I create an in memory DbContext with Entity Framework 6?

How do I create an in memory version of a DbContext for testing in entity framework 6? I cannot use .NET core for this project, it must be e.f. 6. I already have a custom db context created that connects to sql server and works great....Doing this in .NET...
c# entity-framework entity-framework-6
asked by jjxtra

ASPNet Entity Framework 6 - EF6, mixing async and sync in the same unit of work

I came across some lines of code today that, boiled down, amounts to something like this:...using (var db = new AppDbContext()) { var foo = await db.Foos .Where(m => m.Name == "BuzzBaz" ) .FirstAsync(); foo.Name = "Quxx"; db.S...
async-await c# entity-framework-6
asked by ooXei1sh

setting a property being passed as a parameter to null

I have the following method:... public bool Method(object obj){ var objType = obj.GetType(); //do some reflection to get obj properties for some logic ... if(someCondition) { obj = null; return false; } if(con...
.net-core c# entity-framework-6
asked by Riz

EntityFramework: Linq on SQL: Contains or IndexOf?

I have a weird situation regarding EntityFramework 6 with .NET 4.5 (C#)....I have (almost) the same query in two different places. But one time it queries agains the database and the second time it queries against in-memory objects. And since I'm filterin...
c# entity-framework entity-framework-6 linq-to-sql
asked by Dee J. Doena

Avoiding duplicates in table

I have 2 Entity classes, Product and Category. Each product has a category, and a category contain many products: ...public class Category { public int ID { get; set; } public string Name { get; set; } public Category(string n...
c# entity-framework-6
asked by S.Bojesen

How to automatically set CreatedOn fields with Entity Framework on saved entity and its child properties

Whenever I call ...databaseContext.SaveChanges()..., before data is saved by Entity Framework, I need all objects and their child classes to have the ...CreatedOn... field populated with ...DateTime.Now().......Details: I have a ...BaseEntity... class tha...
c# entity-framework entity-framework-6 inheritance
asked by InspiredBy

Oracle ManagedDataAccess GetDecimal specified cast is not valid

I am using EF6 Oracle.ManagedDataAccess v18.3.0, database first concept (edmx). The problem is that Oracle table stores Number that has higher precision (38 digits), that the default Decimal C# data type to which the oracle Number is mapped. Decimal has p...
c# entity-framework entity-framework-6 oracle oracle-manageddataaccess
asked by Gašper Sladič

How to create field and get data from joined table in Entity Framework 6

I'm using EF6 Code First to work. First I created 2 class:...public class Course { public int Id { get; set; } public string Title { get; set; } public ICollection<Tag> Tags { get; set; } } public class Tag { public int Id { get; set; } ...
.net c# entity-framework entity-framework-6 sql-server
asked by Hiếu Nguyễn Đắc

Entity Framework .Net Core 3.1 - Code First vs Scaffolding

What I'm trying to do is implementing the model in Code First for this basic entities:...public class CompanyType{ public int Id {get;set;} public string CompanyType {get;set;} } public class Company{ public int Id {get;set;} public str...
.net-core c# entity-framework-6 entity-framework-core
asked by DarioN1

How to ignore my logical deleted entities from with LINQ?

I have a structure of cart that contains orders that contains order items that contains order sub items. All this structure also work with logical delete. I have on each level a data delete property. I use Entity Framework 6.2.4...So I have C-O-OI-OSI...H...
c# entity-framework-6 linq
asked by Bastien Vandamme

Order by descending group by Max date, then order by single row in the group by date ascending using linq Method sintax

I have a table like this...Id Date GroupId Text Column1 Column2 ... 1 2020-02-02 1 .... .... ... 2 2020-02-04 1 .... .... ... 3 2020-02-03 1 .... .... ... 4 2020-...
c# entity-framework-6 linq sql sql-server
asked by Ciccio

Unexpected exception chain after updating EF 6.x

I updated from EF6.2 to EF6.4 and I encountered this exception chain:...[VerificationException: Operation could destabilize the runtime.] System.Data.Entity.Core.Metadata.Edm.FacetDescription.Validate(String declaringTypeName) +70 System.Data.Entity...
entity-framework entity-framework-6
asked by InteXX

how to access db context within a static method/class in asp.net core 2

I have an asp.net core 2 webapplication with EF 6. The way I have been using db context so far is using dependency injection provided by asp.net core to inject the context into controllers:...protected DbContext dbContext; public BaseController(DbContext...
asp.net-core c# entity-framework-6
asked by Riz

How to return data from different tables using Sql Query in EF Core without using table valued functions/Linq

How can i select data from two tables using SQL query using ef core. Below are two tables... public class Category { public int Id { get; set; } // Don't want to return this. public string Name { get; set; } // Only want to return this...
c# entity-framework entity-framework-6 entity-framework-core
asked by tiger

LinQ to SQL throws Stackoverflow exception when using Any()

I'm using a LinQ query that looks like this...public List<TEntity> GetEntities<TEntity>(int[] ids) { var someDbSet = new DbSet<TEntity>(); var resultQ = someDbSet.Where(t => !ids.Any() || ids.Contains(t.ID)); //<= crashing line return result...
c# entity-framework-6 linq linq-to-sql postgresql
asked by ionutnespus

How to include derived property of type contained in a List

I've got a data context with a list of pipelines. I want to query one pipeline containing all its properties and sub-properties. One pipeline has got a list of stages. The base stage type is abstract. In the list, there can be stages of different child ty...
.net c# entity-framework entity-framework-6 orm
asked by egon-olsen

Show one record of GridView in Crystal Reports using Entity Framework

Scenario:...I have a Gridview with some records which read from SQL Database, each record of Gridview has a button that use ...CommandName... and ...CommandArgument... with sending ...'<%#Eval("UserId")%>'... to detecting each record with calling them in ...
asp.net c# crystal-reports entity-framework entity-framework-6
asked by Hassan Hosseini

Page 343 of 347
  • ««
  • «
  • …
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • 344
  • 345
  • 346
  • 347
  • »

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!