문제

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 = true });

TicketOrderItem is an extension of OrderItem. When this is now executed I get the following error (translated from german, as I get it in german):

The EntityFramework.Reflection.DynamicProxy-type can not implicitly be converted 
to System.Data.Objects.ObjectQuery<NAMESPACE.TicketOrderItem>.

I already disabled lazy loading and proxy generation (and verified it via debugging, that no proxies are generated):

db.Configuration.LazyLoadingEnabled = false;
db.Configuration.ProxyCreationEnabled = false;

Is there a way to fix that?
Or is this a bug in the "not yet final" EF 6 or an incompability between EF.Extended and EF 6?

도움이 되었습니까?

해결책 2

This works not with the current version of EF.Extended.

다른 팁

Looks like EntityFramework.Extended doesn't work with EF 6 yet. Some of EF namespace changes are causing the problem. You can pull the extended source, remove the old EF reference and change the EF related namespaces from

using System.Data.*;

to

using System.Data.Entity.Core.*;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top