Skip to content

Generated Enum specific Resolve() methods for known enums #2400

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

Closed
russcam opened this issue Nov 21, 2016 · 1 comment
Closed

Generated Enum specific Resolve() methods for known enums #2400

russcam opened this issue Nov 21, 2016 · 1 comment

Comments

@russcam
Copy link
Contributor

russcam commented Nov 21, 2016

KnownEnums.Resolve(Enum e) can be used to get a string value for an enum value. We should generate enum specific Resolve() extension methods to avoid the type check and casting.

@Mpdreamz
Copy link
Member

👍

russcam added a commit that referenced this issue Nov 28, 2016
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Mpdreamz pushed a commit that referenced this issue Nov 29, 2016
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Mpdreamz pushed a commit that referenced this issue Nov 29, 2016
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Conflicts:
	src/CodeGeneration/ApiGenerator/Views/Enums.Generated.cshtml
	src/Elasticsearch.Net/Domain/Enums.Generated.cs
	src/Elasticsearch.Net/Extensions/Extensions.cs
	src/Nest/Mapping/AttributeBased/ElasticsearchCorePropertyAttributeBase.cs
	src/Nest/Mapping/Types/Core/Number/NumberAttribute.cs
awelburn pushed a commit to Artesian/elasticsearch-net that referenced this issue Nov 6, 2017
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes elastic#2400
Conflicts:
	src/Elasticsearch.Net/Domain/Enums.Generated.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants