0

this is my Model :

public class Course
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string Institute { get; set; }
        public string Instructor { get; set; }
        public string Duration { get; set; }
        public Level Level { get; set; }
        public Format Format { get; set; }
        public DateTime Released { get; set; }
        public string FileSize { get; set; }
        public string Desciption { get; set; }
    }
    public enum Level
    {
        Beginner,
        Intermediate,
        Advanced
    }
    public enum Format
    {
        Avi,
        Hd,
        FullHd
    }
    public class CourseDb:DbContext
    {
        public DbSet<Course> Courses { get; set; }
    }

when I want to Create my new Controller with Scoffolding Using EF Template,
It's not create both Level and Format fields while I am using EF5
what's my problem?
Thanks in your advise

Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110

1 Answers1

0

Enum types are currently not supported when scaffolding, which is most likely why the fields are not created.

My advice would be to use a helper method such as : Working with enums in ASP.NET MVC 3

and code it manually.

Update:

Looks like there is ticket logged for the support it here: http://mvcscaffolding.codeplex.com/workitem/10

Community
  • 1
  • 1
uv_man
  • 224
  • 1
  • 3