示例#1
0
    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));
    }
示例#2
0
    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));
    }