Questions tagged [datacontractjsonserializer]

DataContractJsonSerializer is a .NET component that makes it possible to directly serialize .NET objects into JSON data and to deserialize such data back into instances of .NET types.

DataContractJsonSerializer is part of the Microsoft (version 3.5 onwards). It makes it possible to directly serialize .NET objects into data and to deserialize such data back into instances of .NET types.

As with (with which it shares an abstract base class XmlObjectSerializer), DataContractJsonSerializer is intended to serialize data contract types, thus appropriate data contract attributes may be applied to control the serialization of objects from and to JSON.

188 questions
0
votes
2 answers

How to parse json to enum from different sources

I'm getting data in json format from different sources and I'm trying to map them to objects implementing the same interface. The json variable looks something like this from feed 1: {"identifier": 232, "type": "Feed1"} And I'm serializing it using…
johan
  • 6,578
  • 6
  • 46
  • 68
0
votes
1 answer

Custom C# Class Name from JSON

I have some JSON that nicely deserializes (with DataContractJsonSerializer) to: class Datum { /* properties */ } Is there a decoration (in WinRT) to trick the Serializer? Something like this: [DataContract(Name="Datum")] class Hamburger { /*…
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
-1
votes
2 answers

OutOfMemoryException in Custom Serialization - JSON.NET

I created my own Custom Serialization method with JSON.NET, the method looks like : public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var Obj = (xObject)value; writer.WriteStartArray(); …
-1
votes
1 answer

Fast, dynamic one way JSON serialization for .Net

I want to implement serialization from CLR objects into a JSON string, but I have the following constraints: I cannot use an external library. My project is a library itself and I cannot introduce a dependency. Serialization must be one way. i.e.…
Shane
  • 875
  • 1
  • 6
  • 24
-1
votes
1 answer

Exposing WCF class reference method client side

I have a WCF Service. I add reference of a DLL in the WCF service.Now ddl has a class, i'm able to get access of the class at WCF client side by using the serviceknowntypeattribute but not the functions inside the class.Any solution?
Tarun
  • 267
  • 2
  • 9
  • 26
-2
votes
1 answer

Retrieving json Data C#

Not able to retrieve json data below is the json data please suggest me. { "creator_email": "thomas.v@almouj.com", "vcard_info": "BEGIN:VCARD\r\nVERSION:2.1\r\nFN;CHARSET=utf-8:Hyder…
Amrutha
  • 1
  • 1
-2
votes
1 answer

Serialize an object with DataContractJsonSerializer

I have a class which contains some items. I want to serialize an instance of this class to json using the DataContractJsonSerializer : [DataContract] public class Policy { private string expiration { get; set; } private List>…
-3
votes
1 answer

In C#, how to parse json which has a string containing a comma

I am using the DataContractJsonSerializer in C# and I am trying to deserialize the below Json array, how ever it is failing because the "PlaceName" string value contains a comma. Error message: XmlException: The value 'Chicago, IL' cannot be parsed…
davey1971
  • 11
  • 1
1 2 3
12
13