Skip to content

Commit 08718e1

Browse files
committed
Avoid using generic overload for all enum types
1 parent d8eda7a commit 08718e1

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/Microsoft.OpenApi/Extensions/EnumExtensions.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,6 @@ public static string GetDisplayName(this Enum enumValue)
4444
return attribute == null ? enumValue.ToString() : attribute.Name;
4545
}
4646

47-
/// <summary>
48-
/// Gets the enum display name for <see typeparamref="T"/> without the use of reflection.
49-
/// </summary>
50-
/// <typeparam name="T">The type of the enum value.</typeparam>
51-
/// <param name="enumValue">The enum value.</param>
52-
/// <returns>The display string to use.</returns>
53-
public static string GetDisplayName<T>(this T enumValue) where T : Enum
54-
{
55-
return enumValue switch
56-
{
57-
ParameterStyle parameterStyle => parameterStyle.GetDisplayName(),
58-
ParameterLocation parameterLocation => parameterLocation.GetDisplayName(),
59-
ReferenceType referenceType => referenceType.GetDisplayName(),
60-
OperationType operationType => operationType.GetDisplayName(),
61-
SecuritySchemeType securitySchemeType => securitySchemeType.GetDisplayName(),
62-
_ => enumValue.ToString()
63-
};
64-
}
65-
6647
/// <summary>
6748
/// Gets the enum display for name <see cref="ParameterStyle" /> without the use of reflection.
6849
/// </summary>

0 commit comments

Comments
 (0)