-Demo
-Changed build script to support NuGet profiles
This commit is contained in:
@@ -601,6 +601,41 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
// Admin
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImprovedDynamicLinqExample()
|
||||
{
|
||||
dynamic product = new JObject();
|
||||
product.ProductName = "Elbow Grease";
|
||||
product.Enabled = true;
|
||||
product.Price = 4.90m;
|
||||
product.StockCount = 9000;
|
||||
product.StockValue = 44100;
|
||||
|
||||
// All Elbow Grease must go sale!
|
||||
// 50% off price
|
||||
|
||||
product.Price = product.Price / 2;
|
||||
product.StockValue = product.StockCount * product.Price;
|
||||
product.ProductName = product.ProductName + " (SALE)";
|
||||
|
||||
string json = product.ToString();
|
||||
// {
|
||||
// "ProductName": "Elbow Grease (SALE)",
|
||||
// "Enabled": true,
|
||||
// "Price": 2.45,
|
||||
// "StockCount": 9000,
|
||||
// "StockValue": 22050.0
|
||||
// }
|
||||
|
||||
Assert.AreEqual(@"{
|
||||
""ProductName"": ""Elbow Grease (SALE)"",
|
||||
""Enabled"": true,
|
||||
""Price"": 2.45,
|
||||
""StockCount"": 9000,
|
||||
""StockValue"": 22050.0
|
||||
}", json);
|
||||
}
|
||||
|
||||
public class DynamicDictionary : DynamicObject
|
||||
{
|
||||
private readonly IDictionary<string, object> _values = new Dictionary<string, object>();
|
||||
|
||||
@@ -39,7 +39,7 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("4.2.0.0")]
|
||||
[assembly: AssemblyVersion("4.0.2.0")]
|
||||
#if !PocketPC
|
||||
[assembly: AssemblyFileVersion("4.2.13610.1823")]
|
||||
[assembly: AssemblyFileVersion("4.0.2.13622")]
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user