Created
January 26, 2022 21:49
-
-
Save tonysneed/7805e05035ab332e2b85e8984c864c8c to your computer and use it in GitHub Desktop.
Save class as Json
This file contains hidden or 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
void SaveLocalSagaConfig(SagaConfigurationDto sagaConfig) | |
{ | |
var options = new JsonSerializerOptions | |
{ | |
WriteIndented = true, | |
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping | |
}; | |
var json = JsonSerializer.Serialize(sagaConfig, options); | |
File.WriteAllText(settings.SagaConfigPath, json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very cool! Thanks @tonysneed