Class DataHelper
Namespace: Tool.Utils
Assembly: Tool.Net.dll
数据集帮助类
public class DataHelperInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Extension Methods
ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)
Remarks
代码由逆血提供支持
Methods
ConvertDataTableToObjects<TEntity>(DataTable)
将转换成实体类对象数组
public static IList<TEntity> ConvertDataTableToObjects<TEntity>(DataTable dt)Parameters
dt DataTable
Returns
IList<TEntity>
返回实体类对象数组
Type Parameters
TEntity
实体类
ConvertRowToObject<TEntity>(DataRow)
将转换成实体类对象
public static TEntity ConvertRowToObject<TEntity>(DataRow row)Parameters
row DataRow
Returns
TEntity
返回实体类对象
Type Parameters
TEntity
实体类
ConvertRowToObject(Type, DataRow)
将转换成实体类对象
public static object ConvertRowToObject(Type objType, DataRow row)Parameters
objType Type
实体类
row DataRow
Returns
返回实体类对象
DistillCommandParameter(string, string)
提取命令参数
public static IList<string> DistillCommandParameter(string sqlStatement, string paraPrefix)Parameters
sqlStatement string
paraPrefix string
Returns
FillCommandParameterValue(IDbCommand, object)
填充命令参数值
public static void FillCommandParameterValue(IDbCommand command, object entityOrRow)Parameters
command IDbCommand
entityOrRow object
GetColumnValue(object, string)
获取列值
public static object GetColumnValue(object entityOrRow, string columnName)Parameters
entityOrRow object
columnName string
Returns
GetSafeDbValue(object)
获取安全值
public static object GetSafeDbValue(object val)Parameters
val object
Returns
RefreshEntityFields(object, DataRow)
刷新实体字段
public static void RefreshEntityFields(object entity, DataRow row)Parameters
entity object
row DataRow
RefreshEntityFields(object, DataRow, IList<string>)
刷新实体字段
public static void RefreshEntityFields(object entity, DataRow row, IList<string> refreshFields)Parameters
entity object
row DataRow