mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Compatible with .NET CORE
This commit is contained in:
@@ -48,7 +48,7 @@ namespace SqlSugar
|
||||
foreach (PropertyInfo properyty in properties)
|
||||
{
|
||||
var value = properyty.GetValue(parameters, null);
|
||||
if (properyty.PropertyType.IsEnum)
|
||||
if (properyty.PropertyType.IsEnum())
|
||||
{
|
||||
value = Convert.ToInt64(value);
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ namespace SqlSugar
|
||||
.Where(ec => !dbColumns.Any(dc => dc.DbColumnName.Equals(ec.OldDbColumnName, StringComparison.CurrentCultureIgnoreCase)))
|
||||
.Where(ec =>
|
||||
dbColumns.Any(dc => dc.DbColumnName.Equals(ec.DbColumnName)
|
||||
&& ((ec.Length != dc.Length &&!PubMethod.GetUnderType(ec.PropertyInfo).IsEnum&& PubMethod.GetUnderType(ec.PropertyInfo).IsIn(PubConst.StringType)) ||
|
||||
&& ((ec.Length != dc.Length &&!PubMethod.GetUnderType(ec.PropertyInfo).IsEnum()&& PubMethod.GetUnderType(ec.PropertyInfo).IsIn(PubConst.StringType)) ||
|
||||
ec.IsNullable != dc.IsNullable ||
|
||||
IsSamgeType(ec, dc)))).ToList();
|
||||
var renameColumns = entityColumns
|
||||
@@ -222,7 +222,7 @@ namespace SqlSugar
|
||||
ColumnDescription = item.ColumnDescription,
|
||||
Length = item.Length
|
||||
};
|
||||
if (propertyType.IsEnum)
|
||||
if (propertyType.IsEnum())
|
||||
{
|
||||
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(item.Length>9?PubConst.LongType.Name:PubConst.IntType.Name);
|
||||
}
|
||||
@@ -237,7 +237,7 @@ namespace SqlSugar
|
||||
{
|
||||
var propertyType = PubMethod.GetUnderType(ec.PropertyInfo);
|
||||
var properyTypeName = string.Empty;
|
||||
if (propertyType.IsEnum)
|
||||
if (propertyType.IsEnum())
|
||||
{
|
||||
properyTypeName = this.Context.Ado.DbBind.GetDbTypeName(ec.Length > 9 ? PubConst.LongType.Name : PubConst.IntType.Name);
|
||||
}
|
||||
|
@@ -164,7 +164,7 @@ namespace SqlSugar
|
||||
validPropertyName = validPropertyName == "byte[]" ? "byteArray" : validPropertyName;
|
||||
CSharpDataType validPropertyType = (CSharpDataType)Enum.Parse(typeof(CSharpDataType), validPropertyName);
|
||||
string bindProperyTypeName = bindPropertyType.Name.ToLower();
|
||||
bool isEnum = bindPropertyType.IsEnum;
|
||||
bool isEnum = bindPropertyType.IsEnum();
|
||||
if (isEnum) { validPropertyType = CSharpDataType.@enum; }
|
||||
switch (validPropertyType)
|
||||
{
|
||||
|
@@ -166,7 +166,7 @@ namespace SqlSugar
|
||||
PropertyType = PubMethod.GetUnderType(column.PropertyInfo),
|
||||
TableId = i
|
||||
};
|
||||
if (columnInfo.PropertyType.IsEnum)
|
||||
if (columnInfo.PropertyType.IsEnum())
|
||||
{
|
||||
columnInfo.Value = Convert.ToInt64(columnInfo.Value);
|
||||
}
|
||||
|
@@ -166,7 +166,7 @@ namespace SqlSugar
|
||||
PropertyType=PubMethod.GetUnderType(column.PropertyInfo),
|
||||
TableId = i
|
||||
};
|
||||
if (columnInfo.PropertyType.IsEnum)
|
||||
if (columnInfo.PropertyType.IsEnum())
|
||||
{
|
||||
columnInfo.Value = Convert.ToInt64(columnInfo.Value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user