Here’s a nuget package I made earlier that generates lookup tables and applies foreign keys, and keeps the lookup table rows in sync with the enum:
https://www.nuget.org/packages/ef-enum-to-lookup
Add that to your project and call the Apply method.
Documentation on github: https://github.com/timabell/ef-enum-to-lookup
More Related Contents:
- Improve navigation property names when reverse engineering a database
- Debug code-first Entity Framework migration codes
- Entity Framework Code First Using Guid as Identity with another Identity Column
- Code-first vs Model/Database-first [closed]
- Entity Framework: One Database, Multiple DbContexts. Is this a bad idea? [closed]
- What’s the difference(s) between .ToList(), .AsEnumerable(), AsQueryable()?
- Entity Framework (EF) Code First Cascade Delete for One-to-Zero-or-One relationship
- Unique Key constraints for multiple columns in Entity Framework
- Entity Framework 6 Code first Default value
- EF Code First “Invalid column name ‘Discriminator'” but no inheritance
- How do I detach objects in Entity Framework Code First?
- How to include a child object’s child object in Entity Framework 5
- Order navigation properties when using Include and/or Select methods with EF 4.1 Code-First?
- Entity framework code-first null foreign key
- Entity Framework loading child collection with sort order
- Mapping Database Views to EF 5.0 Code First w/Migrations
- How do I singularize my tables in EF Code First?
- Set decimal(16, 3) for a column in Code First Approach in EF4.3 [duplicate]
- How to create index in Entity Framework 6.2 with code first
- DbSet.Find method ridiculously slow compared to .SingleOrDefault on ID
- How do you ensure Cascade Delete is enabled on a table relationship in EF Code first?
- mapping private property entity framework code first [duplicate]
- What is the syntax for self referencing foreign keys in EF Code First?
- Entity Framework Code First : Setting up One-To-One foreign key association using Annotations
- Mocking or faking DbEntityEntry or creating a new DbEntityEntry
- EF Code First foreign key without navigation property
- DbContext AutoDetectChangesEnabled set to false detecting changes
- LINQ To Entities + Include + Anonymous type issue
- Why does EF5 code first use datetime2 when inserting a nullable datetime into the database?
- Entity framework code first delete with cascade