Add PostgreSQL enums support to scaffolding
See original GitHub issueAt least two things needed for it:
- generation of C# enums for enum types
- generation of
DataType.Enum
in mappings
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Entity framework Core - Scaffolding enum
PostgreSQL and MySQL have a string enum type. NpgSQL supports them but scaffolding seems to be tricky. The mappings will be generated but...
Read more >Enum Type Mapping
If you're creating your model from an existing database, the provider will recognize enums in your database, and scaffold the appropriate HasPostgresEnum() ...
Read more >Documentation: 15: 8.7. Enumerated Types
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >How to use Enums when using Entity Framework Core with ...
It's pretty simple — we inherit from DbContext (from the Microsoft.EntityFrameworkCore namespace), and add a DbSet property for each entity we' ...
Read more >Documentation: 15: 9.10. Enum Support Functions
Returns the range between the two given enum values, as an ordered array. The values must be from the same enum type. If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So:
To recap: Suppose I have a postgres enum type a_db. There should be the ability to generate C# enum A_gen by the values of a_db. But, also, if a developer wants they should have the ability to map their own C# enum A_dev to database enum a_db and don’t get A_gen generated (turn off the particular enum generation).
@MaceWindu , mappings in npgsql version are configured with their new NpgsqlDataSource . They described the logic of their movement to the data source approach in the release notes. Could you tell if you have already moved your mapping code base to their data source?