mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
odbc emit
This commit is contained in:
parent
8aca0f0f2b
commit
d58de6b9c3
@ -68,6 +68,8 @@ namespace SqlSugar
|
||||
private static readonly MethodInfo getJson = typeof(IDataRecordExtensions).GetMethod("GetJson");
|
||||
private static readonly MethodInfo getArray = typeof(IDataRecordExtensions).GetMethod("GetArray");
|
||||
private static readonly MethodInfo getEntity = typeof(IDataRecordExtensions).GetMethod("GetEntity", new Type[] { typeof(SqlSugarProvider) });
|
||||
private static readonly MethodInfo getMyIntNull = typeof(IDataRecordExtensions).GetMethod("GetMyIntNull");
|
||||
private static readonly MethodInfo getMyInt= typeof(IDataRecordExtensions).GetMethod("GetMyInt");
|
||||
|
||||
private delegate T Load(IDataRecord dataRecord);
|
||||
private Load handler;
|
||||
@ -359,6 +361,8 @@ namespace SqlSugar
|
||||
method = isNullableType ? getConvertInt16 : getInt16;
|
||||
if (bindProperyTypeName == "uint32"&&this.Context.CurrentConnectionConfig.DbType.IsIn(DbType.MySql,DbType.MySqlConnector))
|
||||
method = null;
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.OceanBaseForOracle)
|
||||
method = isNullableType ? getMyIntNull : getMyInt;
|
||||
break;
|
||||
case CSharpDataType.@bool:
|
||||
if (bindProperyTypeName == "bool" || bindProperyTypeName == "boolean")
|
||||
|
@ -133,6 +133,28 @@ namespace SqlSugar
|
||||
var result = dr.GetInt16(i);
|
||||
return result;
|
||||
}
|
||||
public static Int32? GetMyIntNull(this IDataRecord dr, int i)
|
||||
{
|
||||
if (dr.IsDBNull(i))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (dr.GetDataTypeName(i) == "NUMBER")
|
||||
{
|
||||
return Convert.ToInt32(dr.GetDouble(i));
|
||||
}
|
||||
var result = dr.GetInt32(i);
|
||||
return result;
|
||||
}
|
||||
public static Int32 GetMyInt(this IDataRecord dr, int i)
|
||||
{
|
||||
if (dr.GetDataTypeName(i) == "NUMBER")
|
||||
{
|
||||
return Convert.ToInt32(dr.GetDouble(i));
|
||||
}
|
||||
var result = dr.GetInt32(i);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Int32? GetConvertInt32(this IDataRecord dr, int i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user