Skip to content

Error when updating-from-query in TPH: "The destination column could not be found" (EF6) #315

Description

@cjmairair

Example of problem:

Let's say I have a base class, Animal, and there are different subclasses, in an EF TPH (Table per Hierarchy) setup.

var age = 123;
context.Animals.Where(...).Update(a => new Animal() { Age = age });  // throws Exception

The exception is "The destination column could not be found: age".

FYI: The property name "age" is the same as the column name in the DB ("age").

So, after reading Issue #238 , I though that my problem would be fixed by downloading the latest version:

Z.EntityFramework.Plus.EF6.dll - 1.7.14.0
Z.EntityFramework.Extensions.dll - 3.14.7.0

But it's not.

I also tried novamxd's forked code (from his repository) (see Issue #245), which supposedly fixed this problem, but it doesn't.

I know that this problem is related to "updating from query" and not "batch updating", but still, I was hoping that novamxd's code would fix this.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions