-Examples!
This commit is contained in:
@@ -7,6 +7,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Serializer
|
||||
{
|
||||
public class DeserializeObject
|
||||
{
|
||||
#region Types
|
||||
public class Account
|
||||
{
|
||||
public string Email { get; set; }
|
||||
@@ -14,16 +15,18 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Serializer
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public IList<string> Roles { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void Example()
|
||||
{
|
||||
#region Usage
|
||||
string json = @"{
|
||||
""Email"": ""james@example.com"",
|
||||
""Active"": true,
|
||||
""CreatedDate"": ""2013-01-20T00:00:00Z"",
|
||||
""Roles"": [
|
||||
""User"",
|
||||
""Admin""
|
||||
'Email': 'james@example.com',
|
||||
'Active': true,
|
||||
'CreatedDate': '2013-01-20T00:00:00Z',
|
||||
'Roles': [
|
||||
'User',
|
||||
'Admin'
|
||||
]
|
||||
}";
|
||||
|
||||
@@ -31,6 +34,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Serializer
|
||||
|
||||
Console.WriteLine(account.Email);
|
||||
// james@example.com
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user