Exemplo n.º 1
0
        public JsonNetResult()
        {
            SerializerSettings = new JsonSerializerSettings();

            SerializerSettings.Converters.Add(new JavaScriptDateTimeConverter());
            Formatting = Formatting.None;
        }
Exemplo n.º 2
0
		static EventsTransport()
		{
			Settings = new JsonSerializerSettings
			{
				Binder = new TypeHidingBinder(),
				TypeNameHandling = TypeNameHandling.All,
			};
		}
Exemplo n.º 3
0
 private static void JsonBodyToSoapXml(Stream json, Stream xml)
 {
   Raven.Imports.Newtonsoft.Json.JsonSerializerSettings settings = new Raven.Imports.Newtonsoft.Json.JsonSerializerSettings();
   settings.Converters.Add(new Raven.Imports.Newtonsoft.Json.Converters.XmlNodeConverter());
   Raven.Imports.Newtonsoft.Json.JsonSerializer serializer = Raven.Imports.Newtonsoft.Json.JsonSerializer.Create(settings);
   using (Newtonsoft.Json.JsonTextReader reader = new Raven.Imports.Newtonsoft.Json.JsonTextReader(new System.IO.StreamReader(json)))
   {
     XmlDocument doc = (XmlDocument)serializer.Deserialize(reader, typeof(XmlDocument));
     if (reader.Read() && reader.TokenType != JsonToken.Comment)
       throw new JsonSerializationException("Additional text found in JSON string after finishing deserializing object.");
     using (XmlWriter writer = XmlWriter.Create(xml))
     {
       doc.Save(writer);
     }
   }
 }
Exemplo n.º 4
0
		protected new JsonNetResult Json(object data)
		{
			var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
			return new JsonNetResult(data, settings);
		}
Exemplo n.º 5
0
 public JsonNetResult(object responseBody, JsonSerializerSettings settings)
     : this(responseBody)
 {
     Settings = settings;
 }
Exemplo n.º 6
0
 public MvcJsonResult()
 {
     SerializerSettings = new JsonSerializerSettings();
 }
Exemplo n.º 7
0
 protected RavenController(IDocumentSession documentSession)
 {
     DocumentSession = documentSession;
     JsonSettings = new JsonSerializerSettings { ContractResolver = new LowercaseContractResolver() };
 }