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 6120915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:43:28+00:00 2026-05-23T15:43:28+00:00

In my application there are two tables. tblEvents EventID UserID Date EventType tblEventTypes EventTypeID

  • 0

In my application there are two tables.

tblEvents

  • EventID
  • UserID
  • Date
  • EventType

tblEventTypes

  • EventTypeID
  • EventName

tblEvents contains a log of events that occurred in our application. One of the columns required when adding an event to the log is the event type. The event type must be the ID of an event type stored within tblEventTypes.

In my application using Entity Framework I created a function import for a stored procedure that adds events to tblEvents. Currently I pass in an integer for event type into the method created by the function import. This just seems unreadable to me as you have no idea what the integer means without looking at the database, finding the event types table, and seeing what event it was.

I would like to create an enum to represent event types. Is there a way to create a dynamic enum that is generated based on the data in tblEventTypes? Just like how EF generates entities based on tables in the database, I would like to generate an enum based off of a table and it’s current data. So adding an event type would be a matter of adding a row to tblEventTypes and then running an update in the EF designer or something that would automatically update my enum in the code.

  • 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-05-23T15:43:29+00:00Added an answer on May 23, 2026 at 3:43 pm

    You can’t use the EF designer for that, but you could use a T4 template to generate the enum.

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

Sidebar

Related Questions

I am creating a calendar application. In the Events table, there are two columns,
In System.Windows.Forms.Application there are two properties called LocalUserAppDataPath and UserAppDataPath . On this computer
Backdrop: There are two forms, the main application form and a form to edit
I'm designing a gallery application for viewing vehicle pictures and there are two parameters:
I'm currently working on an Asp.net MVC Web application. In my solution, there're two
I have an ASP.NET Dynamic Data application that includes two tables, Departments and KPI's
In my application I have two tables (I have more but I'm only discussing
I have two tables (MS SQL Server 2005) with an existing application (no DB
The database of our web application includes two tables: States (idStates, State, Lat, Long)
I'm starting a new application in rhodes and I'm trying to associate two tables.

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.