This item was migrated from the DevDiv work item tracking system [ID=171798].
We should also support nested complex and enum types, like in the following snippet from a customer:
using System.Data.Entity;
namespace EnumTest
{
public class Car
{
public enum CarMake
{
Ferrari,
Ford
}
public int Id { get; set; }
public CarMake Make { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Car> Cars { get; set; }
}
class Program
{
static void Main(string[] args)
{
MyContext context = new MyContext();
context.Cars.Add(new Car());
context.SaveChanges();
}
}
}
Comments: Support for this in Code First is now tracked here: http://entityframework.codeplex.com/workitem/913 This item remains to track the work for Database First and Model First, which will be done for EF6.
We should also support nested complex and enum types, like in the following snippet from a customer:
using System.Data.Entity;
namespace EnumTest
{
public class Car
{
public enum CarMake
{
Ferrari,
Ford
}
public int Id { get; set; }
public CarMake Make { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Car> Cars { get; set; }
}
class Program
{
static void Main(string[] args)
{
MyContext context = new MyContext();
context.Cars.Add(new Car());
context.SaveChanges();
}
}
}
Comments: Support for this in Code First is now tracked here: http://entityframework.codeplex.com/workitem/913 This item remains to track the work for Database First and Model First, which will be done for EF6.