Last active
October 3, 2021 16:15
-
-
Save Guifgr/a4589c8141219f8781188275d0ec63bc to your computer and use it in GitHub Desktop.
AddJsonOptions .NET for enum as string
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
services | |
.AddControllers() | |
.AddJsonOptions(opts => | |
{ | |
var enumConverter = new JsonStringEnumConverter(); | |
opts.JsonSerializerOptions.Converters.Add(enumConverter); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment