I'm using EF 5.0 Code First, in a .NET 4 library. Trying to set a class member to be of an Enum type, but it doesn't get persisted to the database, and no runtime exception occurs when EF is creating the database based on the code.
Of course, when I try to query against that Enum:
var departments = db.Departments
.Where(dep => dep.Name == DepartmentNames.English);
I get an exception saying:
The specified type member 'Name' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
I am using Microsoft's example of an Enum use: http://msdn.microsoft.com/en-us/data/hh859576.aspx
Are Enum members not supported yet? Does EF 5.0 differs somehow when hosted by a .NET 4 environemt than when hosted by a .NET 5 one?