Does EF 4.2 Code First have support for enum types? If so, how do you use it? The following does not create a field for the enum property when using the Nuget EntityFramework package.
public class FooContext : DbContext
{
public IDbSet<Foo> Foos { get; set; }
}
public class Foo
{
public int Id { get; set; }
public string Name { get; set; }
public Category Category { get; set; }
}
public enum Category {One, Two, Three }
var db = new FooContext();
db.Foos.ToList();
EF team has changed versioning so EFv4.2 is not final release of June 2011 CTP. Features from June 2011 CTP should be released as part of .NET Framework 4.5.
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