EF5 Enum mapping to external type issue

entity-framework-5

Is it just me or does this not seem to work?

In model first I dragged in a simple table and created an enum (via convert to enum). Now I've tried with and without creating the enum items in the dialog, but if I tick the reference external type I get:

Schema specified is not valid. Errors: No corresponding object layer
type could be found for the conceptual type
'ControlPanelDevModel.EventType'.

Best Answer

Ok as a supplement to the above I found I've been getting the same error when the mapping an external Enum to database type of tinyint.

The solution is to have your Enum inherit from type "byte" as specified in this post.

Tinyint(byte),SmallInt(Int16) not compatible with Enum in EF5

Related Topic