public override string ToString() { var variablesType = typeof(VersionVariablesJsonModel); var variables = new VersionVariablesJsonModel(); foreach (KeyValuePair <string, string> property in this.GetProperties()) { variablesType.GetProperty(property.Key).SetValue(variables, property.Value); } var serializeOptions = JsonSerializerOptions(); return(JsonSerializer.Serialize(variables, serializeOptions)); }
public override string ToString() { var variablesType = typeof(VersionVariablesJsonModel); var variables = new VersionVariablesJsonModel(); foreach (var(key, value) in this.GetProperties()) { variablesType.GetProperty(key)?.SetValue(variables, value); } var serializeOptions = JsonSerializerOptions(); return(JsonSerializer.Serialize(variables, serializeOptions)); }