Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:03:50+00:00 2026-06-10T12:03:50+00:00

I have built up a code-first model using Entity Framework 5. The classes have

  • 0

I have built up a code-first model using Entity Framework 5.
The classes have several enums.

I started out by putting the model classes in a prototype ASP.NET MVC project.
I also added the

Database.SetInitializer(new DropCreateDatabaseAlways<dbType>());

command to the global.asax.cs file.

Running the MVC application in Visual Studio produced exactly the database schema I wanted in SQL Server (2008 R2). (with int value columns for the enums)

I then copied the model code to the solution where it will actually be used, which is split into several projects, one which has the EF code, another is the ASP.NET MVC part.

I also added the same Initializer to global.asax.cs

Now when I run the project, I do get the correct tables in the database, but for some strange reason, the enum columns are missing from the tables!

How do I make EF produce the enum columns?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:03:51+00:00Added an answer on June 10, 2026 at 12:03 pm

    Enum support is dependent on .NET 4.5 so it will only work when the project targets .NET 4.5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I'm using Entity Framework 4.0 Model First. I have several tables
I have an entity model build using EF4.1 code first, which uses a WCF
Say, we are using EF Code First and we have this simple model: using
I have the following Classes and am using EF 4.2 Code First public class
I'm using the Entity Framework version 4.2. There are two classes in my small
I'm new to Prism, but I have successfully built several WPF/Mvvm-Light applications. I'm using
I have a application built using Zend Framework. I have decided to go with
I am using code first and EF 4.1 im my MVC3 App and have
I am working with entity framework with code fist design pattern. First of all
I have built an open-source application from the source code. Unfortunately, the original executable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.