Entity Framework - Multiple Discrimination

In a Table-Per-Hierachy script, can I distinguish a list of possible values?

eg. for typesColor, DarkColor, LightColor

sort of

 Map<DarkColor>(m => m.Requires("TheColor").HasValue(Red || Blue)
 Map<LightColor>(m => m.Requires("TheColor").HasValue(Yellow || White)

Bad example, but hopefully you get the picture!

+3
source share
2 answers

No, It is Immpossible.

The Entity framework allows you to display only the intersection of conditions, not the union of conditions.
You can see this both in design [1] and in EDMX syntax [2].
* First, the code should have the same display capabilities.

[2] edmx "Open With..." → "Automatic Editor Selector (XML)" , ( intellisense), "" .

+1

, , , , EF , , , , . , , .

1- :) , , DarkColor .

2- 2- [NotMapped] ColorWeight , , .

0

All Articles