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

How to filter and include children using Z.EntityFramework

The query below is using Z.EntityFramework.Plus.EF6 to filter children. Its filtering and including the ...AssetXref... entity correctly however the result is not able to include ...Child.Parent... entity relationship... var result = await _repository.G...
entity-framework entity-framework-6 entity-framework-plus
asked by LP13

Entity Framework 6.3 with ASP.NET Core 3

How do I would use Entity Framework 6.3 with ASP .NET Core 3? Specifically, I wish to generate a model from an existing database. It does not appear that I can add an Entity Data Model unless I target the full .NET Framework (however, isn't Entity Framewo...
asp.net-core c# entity-framework-6
asked by Muaddib878

How to transform string to entity object?

I need to dynamically get an entity object value from string. something like this :...string s = "UserMaster"; string param = "MyUser"; object o = database.s.Find(param); //I need o to become like object o = db.UserMaster.Find(MyUser); ...Sorry I don't kn...
c# entity-framework-6
asked by Nico Yang

Analyzing slow lazy loading in Entity Framework 6

I have a POCO class with a lazy-loaded collection, which currently takes 10 seconds to load, with about 10.000 entries; using Entity Framework 6.3 and SQL Server 2016....I realize that loading 10.000 entries takes some time, and perhaps these times are t...
c# entity-framework entity-framework-6 lazy-loading performance
asked by HugoRune

How to sort LINQ / Entity Framework query by grandchild property

I am running into a problem with a LINQ query. I have the following data structure (Entity Framework classes mapped to a SQL Server DB):...Event has an EventBlocks property with 0 or more EventBlock objects as children. EventBlock has a Details property w...
c# entity-framework entity-framework-6 linq
asked by Inge Schepers

Measuring time for each Entity Framework query

To measure and debug the times for each query in Entity Framework 6.3, I implemented a ...DbCommandInterceptor..., as per ...the accepted answer... to a related question:...public class EFLogger : IDbCommandInterceptor { public void ReaderExecuting(Db...
c# entity-framework entity-framework-6 performance sql-server
asked by HugoRune

How to pass a parameter to a controller from a cshtml view in mvc

net MVC 4 I followed the microsoft tutorials on how to pass a parameter to a controller from a cshtml view in mvc and I keep getting an error that says the resource cannot be found.If I put a break point in the cshtml I can actually see the value of the I...
asp.net asp.net-mvc asp.net-mvc-routing c# entity-framework-6
asked by Shumba Soft

Use Expression<Func<MyEntity, bool>> in Linq on MyEntity.<OtherEntity>.<MyProperty>

I am trying to simplify a method that returns an IQueryable...A, B and C extend BaseEntity containing a enum that I want to compare. context is a entity framework dbcontext....Here is a stripped down version of the method:... return context.MyEntities.Inc...
.net c# entity-framework entity-framework-6 linq
asked by Bensjero

System.MissingMethodException: Method not found: 'UInt32 Npgsql.NpgsqlStatement.get_Rows()

Since today in the morning i get this error when i update or insert anything in the database. This has worked without any problems. Can´t find anything how to solve this....Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating...
asp.net-core entity-framework-6 npgsql
asked by chrisKay

What is the equivalent of EF C# ToListAsync in F#?

I have the following code in C#:...public async Task<List<Table>> GetRows() { return await db.Table.ToListAsync(); } ...where db is an EF 6 DbContext....How do I write the equivalent thing in F# assuming that I access the same DbContext?...I came up w...
c#-to-f# entity-framework-6 f#
asked by costa

Entity Framework slow after upgrade from EF4 to EF6 (EntityFramework.6.2.0)

I'm upgrading an old MVC web application from EF4 to EF6 (and MVC3 to MVC5) using a guide i found on SO. ...Functionally appears OK, but I've noticed performance issues. ...Specific requests on the prod env for this application running MVC3/EF4 finish i...
c# entity-framework-4 entity-framework-6
asked by developer

How to delay transaction open in EF6?

We use ASP.Net MVC + Autofac + EF6. DbContext is wrapped by UnitOfWork. We create it for each http request via Autofac. We also open transaction for whole http request in UnitOfWork constructor....The problem is that not all http requests have to be wrapp...
asp.net-mvc autofac entity-framework-6 entity-framework-plus transactions
asked by Vasily Kornienko

When upgrading EF6, I get the default XML namespace of the project must be the MSBuild XML namespace

I am upgrading my EntityFramework from version 6.2.0 to 6.3.0 but during the upgrade I get the error:...The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="ht...
.net entity-framework entity-framework-6
asked by Stackedup

When querying SQL with EF6 from a WebJob, query fails because it's trying to get a pluralized version of the table

My code looks like this:...public static void DoSomething(TextWriter log) { log.WriteLine("Hey man! I'm running!"); try { using (MyDBContext context = new MyDBContext()) { ...
entity-framework-6 webjob
asked by RFrey

MapToStoredProcedures not available

I saw a few questions related to this on stack overflow but none of them helped. I am using VS 2019 community edition, I created an API project on .NetCore 2.1, and added the following nuget packages. (assuming all EF packages will be included by default)...
asp.net-core-2.1 entity-framework-6 entity-framework-core
asked by Samra

Entity Framework query never returns

I have a very simple EF query below that never returns. The call to Any() just hangs. ...if (!_context.SalesRoundRobinAssignments.Any()) return salesPeopleIds.First(); ...When I look at the sql profiler I don't see that query being executed however I do...
entity-framework entity-framework-6 sql-server
asked by geoff swartz

Mixing raw SQL with IQueryable for dynamic filter

In entity framework 6 is it possible to mix raw SQL generated dynamically with IQueryable like this:...IQueryable<Tree> tree_query = context.Trees.Where(t=>t.Height> 2); IEnumerable<int> tree_additional_filter = context.Database.SqlQuery<int>("SELECT Id F...
c# entity-framework-6 sql system.linq.dynamic
asked by Krk ÄŒrn

Entity Framework - Simple query takes 3 minutes to complete

I'm using Entity Framework 6 Code First with an Oracle database (using Devart DotConnect for Oracle)...With a specific query with a SingleOrDefault, the query takes 1 second to complete :...-- Executing at 08.10.2019 10:04:04 +02:00 -- Completed in 1211 m...
devart entity-framework-6 oracle
asked by Gab

Disable deletion for records with dependencies

I want to delete records from my database only which don't have any dependencies. ...eg...:- ...Company... Table has ...Company Pk... primary key and it is the foreign key for ...department... table and ...location... table. So the system should not allow...
c# dto entity-framework-6 model-view-controller
asked by Samadhi Upeshala

Check for null entities in EF statement

I have a statement like this:...AssignedCas AssignedCase in caseList.GroupBy(o => o.CaseBatch.CaseBatchName) .Select(g => g.First()).ToList() ...But at time ...o.CaseBatch.CaseBatchName... can be ...null..., in which ca...
c# entity-framework-6
asked by user1144596

Page 339 of 347
  • ««
  • «
  • …
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • …
  • »
  • »»

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!