From ef3fcda97a0ed7bf1edd44eed4f5965d13a4bb45 Mon Sep 17 00:00:00 2001 From: testfirstcoder Date: Tue, 26 Mar 2024 18:06:05 +0100 Subject: [PATCH] use GetValues method instead of GetNames (#4828) --- .../SwaggerToTypeScriptClientGeneratorViewModel.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/NSwagStudio/ViewModels/CodeGenerators/SwaggerToTypeScriptClientGeneratorViewModel.cs b/src/NSwagStudio/ViewModels/CodeGenerators/SwaggerToTypeScriptClientGeneratorViewModel.cs index 95271d2c1..70a90c40e 100644 --- a/src/NSwagStudio/ViewModels/CodeGenerators/SwaggerToTypeScriptClientGeneratorViewModel.cs +++ b/src/NSwagStudio/ViewModels/CodeGenerators/SwaggerToTypeScriptClientGeneratorViewModel.cs @@ -73,9 +73,8 @@ public OpenApiToTypeScriptClientCommand Command .ToArray(); /// Gets the list of date time types. - public TypeScriptDateTimeType[] DateTimeTypes { get; } = Enum.GetNames(typeof(TypeScriptDateTimeType)) - .Select(t => (TypeScriptDateTimeType)Enum.Parse(typeof(TypeScriptDateTimeType), t)) - .ToArray(); + public TypeScriptDateTimeType[] DateTimeTypes { get; } = + (TypeScriptDateTimeType[])Enum.GetValues(typeof(TypeScriptDateTimeType)); /// Gets the list of null values. public TypeScriptNullValue[] NullValues { get; } = Enum.GetNames(typeof(TypeScriptNullValue))