- 调整 FreeSql.Provider.SqlServer 引用Microsoft.Data.SqlClient #391;

This commit is contained in:
28810
2020-07-27 19:39:12 +08:00
parent e80f179663
commit 072a8b7cfa
10 changed files with 40 additions and 10 deletions

View File

@ -4,7 +4,11 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
#if microsoft
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.Globalization;
using System.Text;
@ -44,7 +48,7 @@ namespace FreeSql.SqlServer
}
public override DbParameter[] GetDbParamtersByObject(string sql, object obj) =>
Utils.GetDbParamtersByObject<SqlParameter>(sql, obj, "@", (name, type, value) =>
Utils.GetDbParamtersByObject<DbParameter>(sql, obj, "@", (name, type, value) =>
{
if (value?.Equals(DateTime.MinValue) == true) value = new DateTime(1970, 1, 1);
var ret = new SqlParameter { ParameterName = $"@{name}", Value = value };