1

i had a question with changing a saved entity to a new Type, for Example:

I have a root class called Node, a inherited class called material, from material there are two classes inherited from material, textile and the second called compound

in the database a have now 4 Tables, called: Node, Material, Textile, Compound

When i create a Material and saved it, i have rows in Node and Material.

Now i want to change A Material to a Textile, how can i do this? I don't want to remove the material first and create a new Textile, my plan is to update the material entity to textile entity.

is this possible?

Andrija
  • 21
  • 1

1 Answers1

0

Changing Inherited types is not supported in EF out of the box. Normally one creates stored procedure that handles this change at SQL level, you might want to have a look here.

Community
  • 1
  • 1
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265