- 调整内部参数化处理逻辑,为以后 Where 条件参数化做准备;

This commit is contained in:
28810
2019-11-22 05:58:17 +08:00
parent 71dbd75a72
commit 12be7f0051
32 changed files with 213 additions and 97 deletions

View File

@ -1,4 +1,5 @@
using FreeSql.Internal;
using FreeSql.Internal.Model;
using System;
using System.Collections.Generic;
using System.Data;
@ -16,9 +17,10 @@ namespace FreeSql.Odbc.Default
public OdbcUtils(IFreeSql orm) : base(orm) { }
public OdbcAdapter Adapter => _orm.GetOdbcAdapter();
public override DbParameter AppendParamter(List<DbParameter> _params, string parameterName, Type type, object value)
public override DbParameter AppendParamter(List<DbParameter> _params, string parameterName, ColumnInfo col, Type type, object value)
{
if (string.IsNullOrEmpty(parameterName)) parameterName = $"p_{_params?.Count}";
if (type == null && col != null) type = col.Attribute.MapType ?? col.CsType;
if (value?.Equals(DateTime.MinValue) == true) value = new DateTime(1970, 1, 1);
var ret = new OdbcParameter { ParameterName = QuoteParamterName(parameterName), Value = value };
var tp = _orm.CodeFirst.GetDbInfo(type)?.type;