Questions tagged [entity-framework-extended]

Entity Framework Extended provides batch updates, deletes and queries for Entity Framework. Additionally it can be used to cache query results and audit modifications of your entities and their properties.

Entity Framework Extended provides useful open source extensions to Entity Framework. Currently it supports the following features:

  • Batch Updates and Batch Deletes to delete or update batches of entities without loading them into the context first.
  • Future Queries to execute multiple queries in a single batch.
  • Query Result Cache to, well, cache query results (with cache policy / expiry).
  • Audit Log to record which entities (and which of their properties) have changed.

Entity Framework Extended is provided as a NuGet package.

23 questions
34
votes
9 answers

How to Bulk Update records in Entity Framework?

I am trying to bulk update records using Entity Framework. I have tried Entity Framework.Extensions Update method. The Update method is able to bulk update for a set of records with same set of update values. Example: Id - …
Ujjwal27
  • 1,103
  • 3
  • 15
  • 31
16
votes
2 answers

EntityFramework.Extended Future error (JIT Compiler internal limitation)

I am working with Code First EntityFramework (version="6.1.0") and EntityFramework.Extended (version="6.1.0.96, the latest build at the moment from here. The DbContext exposes the DbSets which are accessed like: var set =…
Vedran Mandić
  • 1,084
  • 11
  • 21
4
votes
1 answer

"Invalid column name" error performing update with EntityFramework.Extended

I'm using the EntityFramework.Extended library to do a set of batch updates. The important parts of the table I'm updating look like this: CREATE TABLE [dbo].[BoosterTargetLog] ( [Id] BIGINT NOT NULL identity PRIMARY KEY, [CustomerUserId]…
3
votes
2 answers

Bulk insert using EntityFramework Extended

According to this, bulk insert in Entity can be made using the following code: var customers = GetCustomers(); db.Customers.AddRange(customers); db.SaveChanges(); I used SQL Profiler to verify how many insert queries were executed and I…
Luis Teijon
  • 4,769
  • 7
  • 36
  • 57
3
votes
1 answer

Entity Framework 6 Batch Updates and AuditLog using Entity Framework Extended

I am using Entity Framework 6 and I am using EntityFramework Extended to perform some batch updates and batch deletes. The batch updates and batch deletes work OK however I also need to know the entities that were updated / deleted (i.e. the…
3
votes
1 answer

DBSet.Where(...).Delete() -> "no matching element" which is not true

I am using EF 6.1 with EF.Extended and I am trying to execute the following: if (allRevisions != null && allRevisions.Any(r => r.Item.Id == itemId)) allRevisions.Where(r => r.Item.Id == itemId).Delete(); allRevisions is a DbSet from…
3
votes
2 answers

Could not load type 'System.Data.Entity.Core.Mapping.EntityContainerMapping'

When I debug the following code, I receive the message "System.TypeLoadException was caught" when I perform the Delete(). Using db As New ScholarshipEntities db.ApplicationHistories.Where(Function(h) h.HistoryTypeId = 0).Delete() …
3
votes
2 answers

How do I have to pass a MemberInitExpression object

When I run this code I get an exception at the Update method public void UpdateTeststep(Teststep step) { _context.Teststeps.Where(t => t.TeststepId == step.TeststepId).Update(t => step); _context.SaveChanges(); …
Pascal
  • 12,265
  • 25
  • 103
  • 195
3
votes
2 answers

Entity Framework Extended - simple delete is giving me null reference

I've grabbed the Entity Framework Extended source code from nuget and I want to use it's delete expression to delete multiple rows of data using ID. In my code I use PersonID to get ClaimsID. In two tables ClaimsID is an FK and the last table I…
nick gowdy
  • 6,191
  • 25
  • 88
  • 157
3
votes
2 answers

EntityFramework.Extended Update not working - can't convert DynamicProxy

I am using Entity Framework 6 and tried to use EntityFramework.Extended to do some batch updates: db.TicketOrderItems .Where(i => !i.IsDeleted && !i.Order.IsCompleted && i.Order.OrderDate < margin) .Update(i => new TicketOrderItem { IsDeleted =…
2
votes
1 answer

Entity framework extended throws DynamicProxy exception

When trying to do bulk updates using EntityFramework.Extended I get one of two exceptions. Looking at the example I tried: context.ProcessJobs.Where(job => true).Update(job => new ProcessJob { Status = ProcessJobStatus.Processing, …
wayju
  • 130
  • 2
  • 16
2
votes
1 answer

Batch update using EntityFramework.Extended

I am trying to use batch update using Entity framework extended but i am unsure how to do this. So far this the following code that i have: List listIds = new List(); listIds = listIds.Union(hem.ProductList.Where(x => x.CustListID ==…
Supermode
  • 924
  • 3
  • 32
  • 53
2
votes
1 answer

EntityFramework.Extensions simple .Delete() throws null reference exception

So I'm trying something like the following with EntityFramework.Extended: https://github.com/loresoft/EntityFramework.Extended context.Logs.Delete(l => l.Id == 216471); This is the simplest example I can provide. The problem is this and any other…
1
vote
0 answers

Getting the Wrong Data type for a property using Entity Framework.Extensions Future query

I am using Entity Framework 6.1.3 with MySQL 5.6. I have the following query: var qAccounts = _repository.GetAll(m => m.CustomerId == customer.Id).Future(); Later on I iterate through qAccounts using a foreach loop. But as soon as I…
Ralph
  • 559
  • 4
  • 14
1
vote
1 answer

How to fake EntityFramework.Extended FutureQuery?

I'm looking to setup a fake repository. public class FooRepo { public FutureFoo GetById(int id) { var foo = new Foo(); return new FutureValue(foo); } public FutureQuery GetByCategory(int categoryId) { …
1
2