Exemple #1
0
        public static string ToJson <T>(this IEnumerable <T> dataEntitys)
            where T : class
        {
            var output = new StringBuilder(1024);

            using (var writer = new StringWriter(output))
            {
                JsonSerializationWriter.WriteObject(dataEntitys.ToList(), null, writer);
            }
            return(output.ToString());
        }
Exemple #2
0
 public static void ToJson <T>(this IEnumerable <T> dataEntitys, TextWriter writer)
     where T : class
 {
     JsonSerializationWriter.WriteObject(dataEntitys.ToList(), null, writer);
 }
Exemple #3
0
 public static void ToJson <T>(this T dataEntity, TextWriter writer)
     where T : class
 {
     JsonSerializationWriter.WriteObject(dataEntity, null, writer);
 }