C# Class SqlSugar.JsonConverter

** 描述:Json转换类 ** 创始时间:2010-2-28 ** 修改时间:- ** 作者:热心的dakang ** 使用说明:
ファイルを表示 Open project: sunkaixuan/SqlSugar Class Usage Examples

Public Methods

Method Description
ConvertJson ( string json ) : dynamic

json转换object动态类 add duk by 2016-05-19

DataTableToJson ( DataTable table ) : string

dataTable转成JSON add sunkaixuan

DataTableToJson ( DataTable table, string dateFormat ) : string

dataTable转成JSON add sunkaixuan

JsonClass ( object obj ) : dynamic

自定义查询对象转换动态类 add dukang by 2016-05-19

Serialize ( object obj, bool DateConvert = false ) : string

object动态类转换json包 add dukang by 2016-05-19

String2Json ( String s ) : string

过滤特殊字符 add dukang by 2016-05-19

ToJson ( DataSet dataSet ) : string

DataSet转换为Json add dukang by 2016-05-19

ToJson ( DataTable dt ) : string

Datatable转换为Json add dukang by 2016-05-19

ToJson ( DataTable dt, string jsonName ) : string

DataTable转成Json add dukang by 2016-05-19

ToJson ( IDataReader dataReader ) : string

DataReader转换为Json

Private Methods

Method Description
StringFormat ( string str, Type type ) : string

格式化字符型、日期型、布尔型 add dukang by 2016-05-19

Method Details

ConvertJson() public static method

json转换object动态类 add duk by 2016-05-19
public static ConvertJson ( string json ) : dynamic
json string
return dynamic

DataTableToJson() public static method

dataTable转成JSON add sunkaixuan
public static DataTableToJson ( DataTable table ) : string
table System.Data.DataTable
return string

DataTableToJson() public static method

dataTable转成JSON add sunkaixuan
public static DataTableToJson ( DataTable table, string dateFormat ) : string
table System.Data.DataTable
dateFormat string 设置序列化的时间格式
return string

JsonClass() public static method

自定义查询对象转换动态类 add dukang by 2016-05-19
public static JsonClass ( object obj ) : dynamic
obj object
return dynamic

Serialize() public static method

object动态类转换json包 add dukang by 2016-05-19
public static Serialize ( object obj, bool DateConvert = false ) : string
obj object 对象
DateConvert bool 时间戳是否转换成日期类型
return string

String2Json() public static method

过滤特殊字符 add dukang by 2016-05-19
public static String2Json ( String s ) : string
s String
return string

ToJson() public static method

DataSet转换为Json add dukang by 2016-05-19
public static ToJson ( DataSet dataSet ) : string
dataSet System.Data.DataSet DataSet对象
return string

ToJson() public static method

Datatable转换为Json add dukang by 2016-05-19
public static ToJson ( DataTable dt ) : string
dt System.Data.DataTable Datatable对象
return string

ToJson() public static method

DataTable转成Json add dukang by 2016-05-19
public static ToJson ( DataTable dt, string jsonName ) : string
dt System.Data.DataTable
jsonName string
return string

ToJson() public static method

DataReader转换为Json
public static ToJson ( IDataReader dataReader ) : string
dataReader IDataReader DataReader对象
return string