Add inference-based overload to ForNpgsqlHasEnum#621
Add inference-based overload to ForNpgsqlHasEnum#621austindrenski merged 6 commits intonpgsql:devfrom
Conversation
- `PgNameAttribute` is respected for the type and members.
|
@YohDeadfall Updated per your review. |
|
Updated to |
roji
left a comment
There was a problem hiding this comment.
Great idea.
Maybe update the doc enum samples to use this? After it's all it should the preferred method to define an enum assuming you have a CLR one...
One more point is to wait for #2139 to be merged and take a dependency on the appropriate 2.1.x nuget.
|
Scratch that....looks like it fixed itself? |
abc5b40 to
e655147
Compare
|
@roji I've updated the docs to just show the simplest overload. I'm now thinking about whether the old overloads should be obsoleted:
Thoughts? |
|
Going to merge this now. If we decide to obsolete the preexisting overloads, I'll submit that as a separate PR. |
It's true that it's a little strange, but I'd rather continue to keep a clear separation between model definition (which determines what gets created in the database) and application usage. It's not totally implausible that someone may want to create a PostgreSQL enum type and use it from some external, non-EFCore application. I do agree that your new overload is definitely preferred for the vast majority of applications though (so it's good to have changed the docs in this way). |
|
@roji Good point on the external use. |
Closes: #620
PgNameAttributeis respected for the type and members.NpgsqlConnection.GlobalTypeMapper.DefaultNameTranslatorRelated
#605