本文整理匯總了C#中Newtonsoft.Json.Linq.JConstructor.Select方法的典型用法代碼示例。如果您正苦於以下問題:C# JConstructor.Select方法的具體用法?C# JConstructor.Select怎麽用?C# JConstructor.Select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Newtonsoft.Json.Linq.JConstructor
的用法示例。
在下文中一共展示了JConstructor.Select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MergeJConstructor
public void MergeJConstructor()
{
JConstructor c1 = new JConstructor("c1", new[] { 1, 2 });
JConstructor c2 = new JConstructor("c2", new[] { 3, 4 });
c1.Merge(c2);
Assert.AreEqual("c2", c1.Name);
CollectionAssert.AreEquivalent(new[] { 1, 2, 3, 4 }, c1.Select(i => (int)i));
JConstructor c3 = new JConstructor();
c1.Merge(c3);
Assert.AreEqual("c2", c1.Name);
JConstructor c4 = new JConstructor("c4", new[] { 5, 6 });
c1.Merge(c4, new JsonMergeSettings
{
MergeArrayHandling = MergeArrayHandling.Replace
});
Assert.AreEqual("c4", c1.Name);
CollectionAssert.AreEquivalent(new[] { 5, 6 }, c1.Select(i => (int)i));
}