示例#1
0
文件: Hubs.cs 项目: sbauer/AspNetCore
        internal static Unserializable Create()
        {
            // Loops throw off every serializer ;).
            var o = new Unserializable();

            o.Child = o;
            return(o);
        }
示例#2
0
    static void Main()
    {
        var u = new Unserializable
        {
            Age  = 40,
            ID   = 2,
            Name = "Betty"
        };
        var jser     = new JavaScriptSerializer();
        var jsonText = jser.Serialize(u);

        // next line outputs {"Age":40,"ID":2,"Name":"Betty"}
        Console.WriteLine(jsonText);
    }
示例#3
0
文件: Hubs.cs 项目: sbauer/AspNetCore
 public async Task CallWithUnserializableObject()
 {
     await Clients.All.SendAsync("Foo", Unserializable.Create());
 }
示例#4
0
文件: Hubs.cs 项目: sbauer/AspNetCore
 public Unserializable GetUnserializableObject()
 {
     return(Unserializable.Create());
 }