mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 20:43:46 +08:00
Update .net core project
This commit is contained in:
@@ -309,7 +309,7 @@ namespace SqlSugar
|
|||||||
column.ColumnDescription = sugarColumn.ColumnDescription;
|
column.ColumnDescription = sugarColumn.ColumnDescription;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (column.ColumnDescription.IsNullOrEmpty()) column.ColumnDescription = GetPropertyAnnotation(result.Type, column.DbColumnName);
|
if (column.ColumnDescription.IsNullOrEmpty()) column.ColumnDescription = GetPropertyAnnotation(result.Type, column.PropertyName);
|
||||||
if (this.Context.MappingColumns.HasValue())
|
if (this.Context.MappingColumns.HasValue())
|
||||||
{
|
{
|
||||||
var golbalMappingInfo = this.Context.MappingColumns.FirstOrDefault(it => it.EntityName.Equals(result.EntityName, StringComparison.CurrentCultureIgnoreCase) && it.PropertyName == column.PropertyName);
|
var golbalMappingInfo = this.Context.MappingColumns.FirstOrDefault(it => it.EntityName.Equals(result.EntityName, StringComparison.CurrentCultureIgnoreCase) && it.PropertyName == column.PropertyName);
|
||||||
|
@@ -532,13 +532,13 @@ namespace SqlSugar
|
|||||||
FieldValue = value.ObjToStringNew(),
|
FieldValue = value.ObjToStringNew(),
|
||||||
CSharpTypeName = column.PropertyInfo.PropertyType.Name
|
CSharpTypeName = column.PropertyInfo.PropertyType.Name
|
||||||
});
|
});
|
||||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|
//if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|
||||||
{
|
//{
|
||||||
data.Value.FieldValueConvertFunc = it =>
|
// data.Value.FieldValueConvertFunc = it =>
|
||||||
{
|
// {
|
||||||
return UtilMethods.ChangeType2(it, value.GetType());
|
// return UtilMethods.ChangeType2(it, value.GetType());
|
||||||
};
|
// };
|
||||||
}
|
//}
|
||||||
cons.ConditionalList.Add(data);
|
cons.ConditionalList.Add(data);
|
||||||
}
|
}
|
||||||
if (cons.HasValue())
|
if (cons.HasValue())
|
||||||
|
@@ -159,7 +159,7 @@ namespace SqlSugar
|
|||||||
DbColumnInfoList = DbColumnInfoList.Where(it => {
|
DbColumnInfoList = DbColumnInfoList.Where(it => {
|
||||||
if (it.Value.ObjToString()=="0" && it.PropertyType.IsEnum)
|
if (it.Value.ObjToString()=="0" && it.PropertyType.IsEnum)
|
||||||
{
|
{
|
||||||
return it.Value.ObjToInt() != UtilMethods.DefaultForType(it.PropertyType).ObjToInt();
|
return it.Value.ObjToLong() != UtilMethods.DefaultForType(it.PropertyType).ObjToLong();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@ namespace SqlSugar
|
|||||||
if (thisValue == null) return 0;
|
if (thisValue == null) return 0;
|
||||||
if (thisValue is Enum)
|
if (thisValue is Enum)
|
||||||
{
|
{
|
||||||
return (int)thisValue;
|
return Convert.ToInt32(thisValue);
|
||||||
}
|
}
|
||||||
if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval))
|
if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval))
|
||||||
{
|
{
|
||||||
@@ -22,6 +22,21 @@ namespace SqlSugar
|
|||||||
return reval;
|
return reval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long ObjToLong(this object thisValue)
|
||||||
|
{
|
||||||
|
long reval = 0;
|
||||||
|
if (thisValue == null) return 0;
|
||||||
|
if (thisValue is Enum)
|
||||||
|
{
|
||||||
|
return Convert.ToInt64(thisValue);
|
||||||
|
}
|
||||||
|
if (thisValue != null && thisValue != DBNull.Value && long.TryParse(thisValue.ToString(), out reval))
|
||||||
|
{
|
||||||
|
return reval;
|
||||||
|
}
|
||||||
|
return reval;
|
||||||
|
}
|
||||||
|
|
||||||
public static int ObjToInt(this object thisValue, int errorValue)
|
public static int ObjToInt(this object thisValue, int errorValue)
|
||||||
{
|
{
|
||||||
int reval = 0;
|
int reval = 0;
|
||||||
|
Reference in New Issue
Block a user