EF Core compatibility
Describe the bug
Using Visual Studio EF Core, I am adding Intellenum column property (ChannelId type).
Then if I am adding migration (with code-first approach), I get the error:
Unable to create a 'DbContext' of type 'MyDb'. The exception 'The entity type 'ChannelId' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
Looks like it is going to create separate table for this type values, when I expect just column type with type int.
So when it is working for Vogen value objects, for Intellenum it is not.
Is it possible to add such EF Core compatibility?
Steps to reproduce
- Add Intellenum property to db entity class.
- Run add-migration
Expected behaviour
No error, Intellenum property is mapped as it's underlying type for column type.
Howerver I found that using EnumGenerators instead of Intellenum is good enough for my purposes for int values.