I have been trying to convert a status table in my database to be an enum that I can access from code.
The initial setup was a Status table with the few entries I needed included (e.g. Active, Inactive etc). To convert I did as follows:
My solution builds and deploys just fine now. The problem is the following error:
No corresponding object layer type could be found for the conceptual type
I get the feeling that the code knows the way the database should be, but the database has not yet been configured.
How can I fix this? Thank you.
Please note that my Entity Framework approach is Database First.
Make sure your enum name matches the type name. So for example if the enum is lets say "MyProject.Fully.Qualified.EnumName.MyEnum" Should be called "MyEnum" when you create the enum type.
In my case I needed to declare my Enum
as Byte
which is the type I was using in the table property with Entity Framework.
Example:
Public Enum DataState As Byte
Normal=0
Deleted=1
End Enum
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With