generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added http method to debug info - added EnumExtensions to convert enum member values to string - updated editor to 2022.3.16f1 LTS
- Loading branch information
1 parent
80f68ef
commit 0c00440
Showing
6 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System; | ||
|
||
namespace Utilities.Rest | ||
{ | ||
public static class EnumExtensions | ||
{ | ||
private static readonly JsonSerializerSettings settings = new JsonSerializerSettings | ||
{ | ||
Converters = { new StringEnumConverter() } | ||
}; | ||
|
||
public static string ToEnumMemberString<T>(this T value) where T : Enum | ||
{ | ||
const string empty = ""; | ||
const string quote = "\""; | ||
return JsonConvert.SerializeObject(value, settings).Replace(quote, empty); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters