Thanks to visit codestin.com
Credit goes to github.com

Skip to content

larrynung/LevelUp.Serializer.JsonNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LevelUp.Serializer.JsonNet

Feature

  • Let LevelUp.Serializer support JsonNet

Example

using System;
using LevelUp.Serializer;
using LevelUp.Serializer.JsonNet;

namespace ConsoleApplication46
{
    public class Person
    {
        public string Name { get; set; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            var larry = new Person()
            {
                Name = "Larry Nung"
            };

            var serializer = new JsonNetSerializer();
            var json = serializer.SerializeToText(larry);

            Console.WriteLine(json);
            Serializer.RegisterSerializer(SerializerType.Json, typeof(JsonNetSerializer));
            json = Serializer.SerializeToText(larry, SerializerType.Json);

            Console.WriteLine(json);


            json = larry.ToJSON();

            Console.WriteLine(json);


            larry = Serializer.DeSerializeFromText<Person>(json, SerializerType.Json);

            Console.WriteLine(larry.Name);
        }
    }
}

Link

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors