-Code reformat

This commit is contained in:
James Newton-King
2013-10-20 15:08:39 +13:00
parent d03963016e
commit bcd6982419
466 changed files with 71645 additions and 71598 deletions
@@ -5,37 +5,37 @@ using System.Text;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{
public class ReferenceLoopHandlingIgnore
{
#region Types
public class Employee
public class ReferenceLoopHandlingIgnore
{
public string Name { get; set; }
public Employee Manager { get; set; }
}
#endregion
public void Example()
{
#region Usage
Employee joe = new Employee { Name = "Joe User" };
Employee mike = new Employee { Name = "Mike Manager" };
joe.Manager = mike;
mike.Manager = mike;
string json = JsonConvert.SerializeObject(joe, Formatting.Indented, new JsonSerializerSettings
#region Types
public class Employee
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
});
public string Name { get; set; }
public Employee Manager { get; set; }
}
#endregion
Console.WriteLine(json);
// {
// "Name": "Joe User",
// "Manager": {
// "Name": "Mike Manager"
// }
// }
#endregion
public void Example()
{
#region Usage
Employee joe = new Employee { Name = "Joe User" };
Employee mike = new Employee { Name = "Mike Manager" };
joe.Manager = mike;
mike.Manager = mike;
string json = JsonConvert.SerializeObject(joe, Formatting.Indented, new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
});
Console.WriteLine(json);
// {
// "Name": "Joe User",
// "Manager": {
// "Name": "Mike Manager"
// }
// }
#endregion
}
}
}
}
}