¡@

Home 

c# Programming Glossary: jsonserializer

Getting ServiceStack to retain type information

http://stackoverflow.com/questions/10750571/getting-servicestack-to-retain-type-information

Woof var container new Container Animal new Dog var json JsonSerializer.SerializeToString container var container2 JsonSerializer.DeserializeFromString.. JsonSerializer.SerializeToString container var container2 JsonSerializer.DeserializeFromString Container json Dog container.Animal .Speak.. a specific JSON serializer implementation. ServiceStack's JsonSerializer stores this type info in the __type property and since it can..

Exclude property from serialization via custom attribute (json.net)

http://stackoverflow.com/questions/13588022/exclude-property-from-serialization-via-custom-attribute-json-net

on the properties and initialize the specific instance of JsonSerializer with a hook that knows to look for that attribute. At first..

Deserializing JSON data to C# using JSON.NET

http://stackoverflow.com/questions/2546138/deserializing-json-data-to-c-sharp-using-json-net

transforming the string into the desired class property. JsonSerializer serializer new JsonSerializer var o JObject serializer.Deserialize.. the desired class property. JsonSerializer serializer new JsonSerializer var o JObject serializer.Deserialize myjsondata MyAccount.EmployeeID..

Parsing JSON data with C#

http://stackoverflow.com/questions/4109807/parsing-json-data-with-c-sharp

between JSON text and a .NET object is using the JsonSerializer. The JsonSerializer converts .NET objects into their JSON equivalent.. text and a .NET object is using the JsonSerializer. The JsonSerializer converts .NET objects into their JSON equivalent and back again...

Deserializing JSON when sometimes array and sometimes object

http://stackoverflow.com/questions/5224697/deserializing-json-when-sometimes-array-and-sometimes-object

JsonReader reader Type objectType object existingValue JsonSerializer serializer if reader.TokenType JsonToken.StartArray return serializer.Deserialize.. Which works fine except I now get a new exception Inside JsonSerializerInternalReader.cs CreateValueInternal Unexpected token while.. JsonReader reader Type objectType object existingValue JsonSerializer serializer if reader.TokenType JsonToken.StartArray return..

RestSharp JSON Parameter Posting

http://stackoverflow.com/questions/6312970/restsharp-json-parameter-posting

DataFormat.Json request.AddBody request.JsonSerializer.Serialize new A foo B bar RestResponse response client.Execute.. DataFormat.Json request.AddBody new A foo B bar uses JsonSerializer If you just want POST params instead which would still map to..

Json.NET: Deserializing nested dictionaries

http://stackoverflow.com/questions/6416017/json-net-deserializing-nested-dictionaries

JsonReader reader Type objectType object existingValue JsonSerializer serializer if reader.TokenType JsonToken.StartObject reader.TokenType..

How to parse json in C#?

http://stackoverflow.com/questions/6620165/how-to-parse-json-in-c

try it . It has the following features LINQ to JSON The JsonSerializer for quickly converting your .NET objects to JSON and back again..

ServiceStack.Text how to serialize class to JSon

http://stackoverflow.com/questions/7307100/servicestack-text-how-to-serialize-class-to-json

in the same way you would if you were using MS DataContractJsonSerializer e.g DataContract public class MyClass public string WillNotSerializeString.. set Then you can use either the static utility methods on JsonSerializer to De serialize it or the more terse extension methods e.g var..

How to implement custom JsonConverter in JSON.NET to deserialize a List of base class objects

http://stackoverflow.com/questions/8030538/how-to-implement-custom-jsonconverter-in-json-net-to-deserialize-a-list-of-base

LastName LastName3 I don't want to use TypeNameHandling JsonSerializerSettings. I am specifically looking for custom JsonConverter.. JsonReader reader Type objectType object existingValue JsonSerializer serializer Load JObject from stream JObject jObject JObject.Load.. override void WriteJson JsonWriter writer object value JsonSerializer serializer throw new NotImplementedException Hope this helps...

Deserializing heterogenous JSON array into covariant List<> using JSON.NET

http://stackoverflow.com/questions/8241392/deserializing-heterogenous-json-array-into-covariant-list-using-json-net

JsonReader reader Type objectType object existingValue JsonSerializer serializer Load JObject from stream JObject jObject JObject.Load..

How to create a JSON.NET Date to String custom Converter

http://stackoverflow.com/questions/8639315/how-to-create-a-json-net-date-to-string-custom-converter

JsonReader reader Type objectType object existingValue JsonSerializer serializer return DateTime.Parse reader.Value.ToString public.. override void WriteJson JsonWriter writer object value JsonSerializer serializer writer.WriteValue DateTime value .ToString dd MM..

Serializing null in JSON.NET

http://stackoverflow.com/questions/8833961/serializing-null-in-json-net

override void WriteJson JsonWriter writer object value JsonSerializer serializer string strValue value as string if strValue null.. Test public void Test var foo new Foo var settings new JsonSerializerSettings ContractResolver new SpecialContractResolver Assert.AreEqual..

Cannot deserialize JSON array into type - Json.NET

http://stackoverflow.com/questions/9452901/cannot-deserialize-json-array-into-type-json-net

JsonReader reader Type objectType object existingValue JsonSerializer serializer reader.Read start array reader.Read start object.. override void WriteJson JsonWriter writer object value JsonSerializer serializer throw new NotImplementedException And tag the CountryModel..