本文整理汇总了C#中Payload.AddJson方法的典型用法代码示例。如果您正苦于以下问题:C# Payload.AddJson方法的具体用法?C# Payload.AddJson怎么用?C# Payload.AddJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payload
的用法示例。
在下文中一共展示了Payload.AddJson方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testAddJson
public void testAddJson()
{
var payload = new Payload();
var json = new Dictionary<string, object>
{
{"schema", "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0"},
{"data", new Dictionary<string, object>
{
{ "schema", "iglu:com.acme/test/jsonschema/1-0-0" },
{ "data", new Dictionary<string, object>
{
{ "user_type", "test" }
}
}
}
}
};
payload.AddJson(json, false, "ue_px", "ue_pr");
var pairs = payload.NvPairs;
var expected = @"{""schema"":""iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0"",""data"":{""schema"":""iglu:com.acme/test/jsonschema/1-0-0"",""data"":{""user_type"":""test""}}}";
Assert.AreEqual(pairs["ue_pr"], expected);
}