CreateAPerson() public static method

public static CreateAPerson ( ) : Person
return Person
        public void Serialize()
        {
            var person = UsefulFunctions.CreateAPerson();

            var personAsJson = JsonConvert.SerializeObject(person, Formatting.Indented);

            Console.Out.WriteLine(personAsJson);
        }
Beispiel #2
0
        public void Serialize()
        {
            var person = UsefulFunctions.CreateAPerson();

            var serializer = new XmlSerializer(typeof(Person));

            var writer = new StringWriter();

            serializer.Serialize(writer, person);
            Console.Out.WriteLine(writer.ToString());
        }