mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 12:47:57 +08:00
-
This commit is contained in:
parent
be29201171
commit
32d2a8b4ee
@ -24,34 +24,25 @@ namespace SqlSugar
|
||||
var entityType = parameters.GetType();
|
||||
var isDictionary = entityType.IsIn(UtilConstants.DicArraySO, UtilConstants.DicArraySS);
|
||||
if (isDictionary)
|
||||
{
|
||||
DictionaryToParameters(parameters, sqlParameterKeyWord, result, entityType);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProperyToParameter(parameters, propertyInfo, sqlParameterKeyWord, result, entityType);
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
protected void ProperyToParameter(object parameters, PropertyInfo[] propertyInfo, string sqlParameterKeyWord, List<SugarParameter> listParams, Type entityType)
|
||||
{
|
||||
PropertyInfo[] properties = null;
|
||||
if (propertyInfo != null)
|
||||
{
|
||||
properties = propertyInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
properties = entityType.GetProperties();
|
||||
}
|
||||
|
||||
foreach (PropertyInfo properyty in properties)
|
||||
{
|
||||
var value = properyty.GetValue(parameters, null);
|
||||
if (properyty.PropertyType.IsEnum())
|
||||
{
|
||||
value = Convert.ToInt64(value);
|
||||
}
|
||||
if (value == null || value.Equals(DateTime.MinValue)) value = DBNull.Value;
|
||||
if (properyty.Name.ToLower().Contains("hierarchyid"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user