mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
## v0.9.17 (ODBC)
- 增加 FreeSql.Provider.Odbc,实现 Oracle/SqlServer/MySql 的 Odbc 访问提供; - 增加 FreeSqlBuilder.UseConnectionString 参数 providerType,可解决因包版本冲突时,可能无法反射获得 FreeSql.Provider 对应的类型,通常这个参数不需要设置; - 优化 MaxLength 特性,当指定为 -1 时 DbType 会分别映射类型 text/nvarchar(max)/nvarchar2(4000);
This commit is contained in:
@ -76,7 +76,7 @@ namespace FreeSql.Internal
|
||||
var setMethod = trytb.Type.GetMethod($"set_{p.Name}");
|
||||
var colattr = common.GetEntityColumnAttribute(entity, p);
|
||||
var tp = common.CodeFirst.GetDbInfo(colattr?.MapType ?? p.PropertyType);
|
||||
if (setMethod == null) // 属性没有 set自动忽略
|
||||
if (setMethod == null || (tp == null && p.PropertyType.IsValueType)) // 属性没有 set自动忽略
|
||||
{
|
||||
if (colattr == null) colattr = new ColumnAttribute { IsIgnore = true };
|
||||
else colattr.IsIgnore = true;
|
||||
@ -976,7 +976,7 @@ namespace FreeSql.Internal
|
||||
var ps = type.GetProperties();
|
||||
foreach (var p in ps)
|
||||
{
|
||||
if (sql.IndexOf($"{paramPrefix}{p.Name}", StringComparison.CurrentCultureIgnoreCase) == -1) continue;
|
||||
if (string.IsNullOrEmpty(paramPrefix) == false && sql.IndexOf($"{paramPrefix}{p.Name}", StringComparison.CurrentCultureIgnoreCase) == -1) continue;
|
||||
var pvalue = p.GetValue(obj);
|
||||
if (p.PropertyType == ttype) ret.Add((T)Convert.ChangeType(pvalue, ttype));
|
||||
else ret.Add(constructorParamter(p.Name, p.PropertyType, pvalue));
|
||||
|
Reference in New Issue
Block a user