-
Notifications
You must be signed in to change notification settings - Fork 877
Support for non-generic MapEnum method #4629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for non-generic MapEnum method #4629
Conversation
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took me so long to review this - there's been lots of .NET/EF 7.0 stabilization work recently.
Overall LGTM - see comments below.
| /// Defaults to <see cref="NpgsqlSnakeCaseNameTranslator"/> | ||
| /// </param> | ||
| /// <typeparam name="TEnum">A CLR enum type to be mapped</typeparam> | ||
| /// <typeparam name="TEnum">The .NET enum type to be mapped</typeparam> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI we use the term "CLR" a lot in the docs; though I don't really mind switching to talking about ".NET" (we're already not 100% consistent).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for a long time without answering. I will resolve the commented pieces in the following days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roji just to clarify - should I bring back the old "CLR" stuff for consistency or is it fine this way?
| return found; | ||
| } | ||
|
|
||
| public override bool UnmapEnum(Type clrType, string? pgName = null, INpgsqlNameTranslator? nameTranslator = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at how UnmapComposite is implemented - the generic version actually calls the non-generic version, let's do it the same way with enums.
|
Replaced by #4852 |
These changes resolve #3383 by adding the MapEnum method which accepts System.Type as a parameter.
Implementation is the same as for the non-generic MapComposite method.