zzz projects Entity Framework Core EF Core
Home EF Core 5 Articles Knowledge Base Online Examples
  • Home
  • EF Core 5
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

452 results for: in tag: .net

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 suppose I could do this:...// Get the DbEntityEntry from the DbContext.ChangeTracker... /...
.net c# entity-framework entity-framework-6
asked by Eric

Entity Framework 6 - how to convert this line to async?

I am wondering how do I change this statement to be async?... var findBarCode = context.Barcodes .Where(x => x.Code == barcode) .Select(x => x.Product).FirstOrDefault(); ...I don't see like any ...async where... statement I can use.
.net async-await entity-framework entity-framework-6
asked by chobo2

Entity Framework (6) Performance Optimisation advice

I have an ADO.Net Data Access layer in my application that uses basic ADO.Net coupled with CRUD stored procedures (one per operation e.g. Select_myTable, Insert_myTable). As you can imagine, in a large system (like ours), the number of DB objects required...
.net c# entity-framework entity-framework-6 performance
asked by Obsidian Phoenix

How to cancel an async query the right way

This is a follow up question to ...this question.......I'm trying to load data from my database which will take 5-10 seconds, but I want the GUI to stay responsive and also it should be cancellable....private CancellationTokenSource _source; public IEnum...
.net c# entity-framework entity-framework-6 wpf
asked by Staeff

DropCreateDatabaseIfModelChanges EF6 results in System.InvalidOperationException: The model backing the context has changed

After migrating to Entity Framework 6 I get an error when executing unit tests on the build server....I'm using the ...DropCreateDatabaseIfModelChanges... initializer. When I change it to ...MigrateDatabaseToLatestVersion... everything works, but I want t...
.net c# entity-framework entity-framework-6
asked by Chris

EF 6 Multiple Contexts in Same Assembly

I'm using EF6. I've created two namespaces for two different databases each with its own Entity Data model. In EF 3.5 when I created a model from a database the generated classes were all kept in a single file built from the context. I see in EF 6 templat...
.net c# entity-framework entity-framework-6
asked by Mike G

Best practices for integrating ASP.NET Identity - do they exist?

I'm using ASP.NET Identity with a new website and there don't seem to be many (any?) examples of how to do this in a decoupled manner. I do not want my domain model's ...DomainUser... class to have to inherit from ...Microsoft.AspNet.Identity.EntityFramew...
.net asp.net asp.net-identity entity-framework entity-framework-6
asked by joelmdev

How can I parse a string into a UNIQUEIDENTIFIER?

I'm writing an Entity Framework LINQ query in which I want to parse a string into a UNIQUEIDENTIFIER (aka GUID) as part of the ...WHERE... clause:...public IEnumerable<User> Find(Guid guid) { return dbContext .Users .Where(user => Guid...
.net entity-framework entity-framework-6 guid sql-server
asked by Sam

How can I configure Entity Framework to automatically trim values retrieved for specific columns mapped to char(N) fields?

I'm working with a third-party database in which all text values are stored as ...char(n).... Some of these text values are primary keys, whereas others are just normal human-readable text. For the latter, I want retrieved values to be automatically trimm...
.net entity-framework entity-framework-6 sql trim
asked by Sam

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 to do this with migrations, but I'm looking for a way to do this using the fluent configuration interface:... protected overr...
.net c# ef-code-first entity-framework entity-framework-6
asked by ECC-Dan

WPF and EF6 mark model entity as having chnages

Background:... I have a wpf 4.5 application that is built with MVVM (MVVM-Light) and Enitity Framework 6 db first. ...I have several viewmodels that have a list/details set up with a list of objects in a listbox and a details grid that displays and allow...
.net entity-framework entity-framework-6 vb.net wpf
asked by J King

EF6 Code First : Entity with multiple relationships

I am creating a new database using EF code-first which contain the following classes: ...Address, Contact, Account, Customer (a sub-class of Account), and SalesOrder. ...The Address class is the one giving me problems at the moment, it can have no foreig...
.net c# entity-framework entity-framework-6 vb.net
asked by David Grogan

Code-first: Mapping entities to existing database tables

I am using Entity Framework 6 code-first with an existing database, but having problems mapping my entities to the database tables....Normally, I would use database-first approach and have my entity and context code generated, but using the designer has b...
.net c# entity-framework entity-framework-5 entity-framework-6
asked by Dave New

How to register a custom EF Code First migration operation for scaffolding?

I have ...class SetIdentitySeedOperation: MigrationOperation..., which sets the identity value for the specified table. To wire it up, I use a custom ...SqlServerMigrationSqlGenerator..., so if I manually write ....AddOperation(new SetIdentitySeedOperatio...
.net c# ef-migrations entity-framework entity-framework-6
asked by chase

Problems using Entity Framework 6 and SQLite

I'm trying to use Entity Framework with SQLite. I had issues integrating it into my main application, so I started a little test from scratch, exactly following the directions on ...http://brice-lambson.blogspot.com/2012/10/entity-framework-on-sqlite.html...
.net c# entity-framework entity-framework-6 sqlite
asked by Xcelled

EF 6 - Cascade Delete on one to many without backreference

I have something like this:...public class Gadget { public int Id { get; set; } public string Name { get; set;} public int SuperHeroId { get; set; } } public class SuperHero { public int Id { get; set; } public virtual ICollection<Gadget> Gadge...
.net entity-framework entity-framework-6 entity-framework-mapping orm
asked by George Mauer

Cascade delete with DbContext and Entity Framework 6

Is there a way to cascade delete entities without modifying foreign keys in DB and without modifying edmx? I have DB with over 100 tables referenced using foreign keys with Delete Rule = No Action....I found this this beautiful code in "Entity Framework ...
.net entity-framework entity-framework-6
asked by Cherven

Schema specified is not valid. Errors: The relationship 'EntityA_EntityBs' was not loaded because the type 'EntityB' is not available

Background...I'm working on an application that uses Entity Framework to query a database from a third-party application. The database has a large number of tables and no foreign keys. I've mapped the relevant tables to entities using Entity Framework Flu...
.net entity-framework entity-framework-6
asked by Sam

Error: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

I recently upgraded/updated Entity Framework in an old project from version 4 or 5 to version 6. Now I get this exception:...An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code...Addit...
.net ado.net c# entity-framework entity-framework-6
asked by Leon Cullens

AddOrUpdate does not modify children

I am using AddOrUpdate in my seed method to keep my permissions up to date, however, in the situation where the below code is updating the existing role (rather than creating it), any new Permissions I created are not being added to the role. What am I do...
.net c# entity-framework entity-framework-6
asked by pquest

Page 1 of 23
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • …
  • »
  • »»

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