Beispiel #1
0
        public void JilPost()
        {
            var json = JilHelper.Serialize(_dtos, new Options(dateFormat: DateTimeFormat.ISO8601,
                                                              excludeNulls: true, includeInherited: true,
                                                              serializationNameFormat: SerializationNameFormat.CamelCase));

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, "api/Values")
            {
                Content = new StringContent(json, Encoding.UTF8, "application/x-jil")
            };

            httpRequestMessage.Headers.Add("Accept", "application/x-jil");

            var response = _jilHttpClient.SendAsync(httpRequestMessage).Result;

            var result =
                JilHelper.Deserialize <List <TestDto> >(response.Content.ReadAsStringAsync()
                                                        .Result, new Options(dateFormat: DateTimeFormat.ISO8601,
                                                                             excludeNulls: true, includeInherited: true,
                                                                             serializationNameFormat: SerializationNameFormat.CamelCase));
        }
Beispiel #2
0
 public static object FromJil(this string json, Type type, Options options = null)
 {
     return(JilHelper.Deserialize(json, type, options));
 }
Beispiel #3
0
 public static T FromJil <T>(this string json, Options options = null)
 {
     return(JilHelper.Deserialize <T>(json, options));
 }
 public static object?ReadJson(this TextReader?textReader, Type type, Options?options = null) =>
 JilHelper.Deserialize(type, textReader, options);
 public static TValue?ReadJson <TValue>(this TextReader?textReader, Options?options = null) =>
 JilHelper.Deserialize <TValue>(textReader, options);