Skip to content

Conversation

@BogdanYarotsky
Copy link
Contributor

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.

Copy link
Member

@roji roji left a 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>
Copy link
Member

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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)
Copy link
Member

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.

@BogdanYarotsky BogdanYarotsky marked this pull request as draft January 5, 2023 19:14
@roji
Copy link
Member

roji commented Jan 7, 2023

Replaced by #4852

@roji roji closed this Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please provide non-generic methods for creating and mapping enums.

2 participants