This is about Entity Framework 5 RTM Code First.
When I map an entity having an existing enum I get this error:
No corresponding object layer type could be found for the conceptual
type ‘[FULL ENUM TYPE NAME]’
Actually it looks for the whole enum in the same namespace of the DbContext.
Some other question (Using Enums with Code First & Entity Framework 5) had an answer that pointed to some blog post where there’s a how-to on how to get this working but it talks about Database-First/Model-First approach.
How can I add an EDM enum type using Code-First approach?
I am afraid it isn’t possible right now – there is known bug in the EF5 http://entityframework.codeplex.com/workitem/532, that is causing the mentioned error.
I was struggling with the similar problem and didn’t find any elegant solution. I ended up with
intcolumn instead of enum column.Edit (problematic model):
Core assembly:
Users assembly: