mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	- 修复 浮点类型 NoneParameter 不使用科学字符串表示;
This commit is contained in:
		@@ -486,14 +486,5 @@
 | 
				
			|||||||
            <param name="that"></param>
 | 
					            <param name="that"></param>
 | 
				
			||||||
            <returns></returns>
 | 
					            <returns></returns>
 | 
				
			||||||
        </member>
 | 
					        </member>
 | 
				
			||||||
        <member name="M:Microsoft.Extensions.DependencyInjection.FreeSqlRepositoryDependencyInjection.AddFreeRepository(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{FreeSql.FluentDataFilter},System.Reflection.Assembly[])">
 | 
					 | 
				
			||||||
            <summary>
 | 
					 | 
				
			||||||
            批量注入 Repository,可以参考代码自行调整
 | 
					 | 
				
			||||||
            </summary>
 | 
					 | 
				
			||||||
            <param name="services"></param>
 | 
					 | 
				
			||||||
            <param name="globalDataFilter"></param>
 | 
					 | 
				
			||||||
            <param name="assemblies"></param>
 | 
					 | 
				
			||||||
            <returns></returns>
 | 
					 | 
				
			||||||
        </member>
 | 
					 | 
				
			||||||
    </members>
 | 
					    </members>
 | 
				
			||||||
</doc>
 | 
					</doc>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -675,6 +675,12 @@ namespace FreeSql.Tests
 | 
				
			|||||||
                    subquery = g.sqlite.Select<ZX.Model.CustomerCheckupGroup>().Where(b => b.Id == a.Id).First(b => b.Group)
 | 
					                    subquery = g.sqlite.Select<ZX.Model.CustomerCheckupGroup>().Where(b => b.Id == a.Id).First(b => b.Group)
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var sklgjlskdg12 = g.sqlite.Select<ZX.Model.CustomerMember>()
 | 
				
			||||||
 | 
					                .Where(a => g.sqlite.Select<ZX.Model.CustomerCheckupGroup>().Any(b => b.MemberId == a.MemberId))
 | 
				
			||||||
 | 
					                .ToUpdate()
 | 
				
			||||||
 | 
					                .Set(a => a.Phone, "123123")
 | 
				
			||||||
 | 
					                .ToSql();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var sklgjlskdg = g.sqlite.Select<ZX.Model.CustomerMember>()
 | 
					            var sklgjlskdg = g.sqlite.Select<ZX.Model.CustomerMember>()
 | 
				
			||||||
                .Where(a => a.CheckupGroups.AsSelect().Any())
 | 
					                .Where(a => a.CheckupGroups.AsSelect().Any())
 | 
				
			||||||
                .ToSql();
 | 
					                .ToSql();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using FreeSql.Internal.Model;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Dameng
 | 
					namespace FreeSql.Dameng
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -95,6 +96,7 @@ namespace FreeSql.Dameng
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
					            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.OleDb;
 | 
					using System.Data.OleDb;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.MsAccess
 | 
					namespace FreeSql.MsAccess
 | 
				
			||||||
@@ -84,6 +85,7 @@ namespace FreeSql.MsAccess
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using MySql.Data.MySqlClient;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.MySql
 | 
					namespace FreeSql.MySql
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -124,6 +125,7 @@ namespace FreeSql.MySql
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Collections.Concurrent;
 | 
					using System.Collections.Concurrent;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.MySql
 | 
					namespace FreeSql.MySql
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -148,6 +149,7 @@ namespace FreeSql.MySql
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Odbc.Dameng
 | 
					namespace FreeSql.Odbc.Dameng
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -101,6 +102,7 @@ namespace FreeSql.Odbc.Dameng
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
					            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Odbc.Default
 | 
					namespace FreeSql.Odbc.Default
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -71,6 +72,7 @@ namespace FreeSql.Odbc.Default
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return Adapter.ByteRawSql(value);
 | 
					            if (type == typeof(byte[])) return Adapter.ByteRawSql(value);
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Odbc.MySql
 | 
					namespace FreeSql.Odbc.MySql
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -95,6 +96,7 @@ namespace FreeSql.Odbc.MySql
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Odbc.Oracle
 | 
					namespace FreeSql.Odbc.Oracle
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -101,6 +102,7 @@ namespace FreeSql.Odbc.Oracle
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
					            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -124,6 +125,7 @@ namespace FreeSql.Odbc.PostgreSQL
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            value = getParamterValue(type, value);
 | 
					            value = getParamterValue(type, value);
 | 
				
			||||||
            var type2 = value.GetType();
 | 
					            var type2 = value.GetType();
 | 
				
			||||||
            if (type2 == typeof(byte[])) return $"'\\x{CommonUtils.BytesSqlRaw(value as byte[])}'";
 | 
					            if (type2 == typeof(byte[])) return $"'\\x{CommonUtils.BytesSqlRaw(value as byte[])}'";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using System;
 | 
				
			|||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.Odbc;
 | 
					using System.Data.Odbc;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Odbc.SqlServer
 | 
					namespace FreeSql.Odbc.SqlServer
 | 
				
			||||||
@@ -87,6 +88,7 @@ namespace FreeSql.Odbc.SqlServer
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ using Oracle.ManagedDataAccess.Client;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Oracle
 | 
					namespace FreeSql.Oracle
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -100,6 +101,7 @@ namespace FreeSql.Oracle
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
					            if (type == typeof(byte[])) return $"hextoraw('{CommonUtils.BytesSqlRaw(value as byte[])}')";
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ using System.Collections;
 | 
				
			|||||||
using System.Collections.Concurrent;
 | 
					using System.Collections.Concurrent;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Net;
 | 
					using System.Net;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
@@ -154,6 +155,7 @@ namespace FreeSql.PostgreSQL
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (_dicIsAssignableFromPostgisGeometry.GetOrAdd(type, t2 => typeof(PostgisGeometry).IsAssignableFrom(type.IsArray ? type.GetElementType() : type)))
 | 
					            if (_dicIsAssignableFromPostgisGeometry.GetOrAdd(type, t2 => typeof(PostgisGeometry).IsAssignableFrom(type.IsArray ? type.GetElementType() : type)))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                var pam = AppendParamter(specialParams, null, null, type, value);
 | 
					                var pam = AppendParamter(specialParams, null, null, type, value);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ using System.Collections.Generic;
 | 
				
			|||||||
using System.Data;
 | 
					using System.Data;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.SqlClient;
 | 
					using System.Data.SqlClient;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.SqlServer
 | 
					namespace FreeSql.SqlServer
 | 
				
			||||||
@@ -99,6 +100,7 @@ namespace FreeSql.SqlServer
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
					            if (type == typeof(byte[])) return $"0x{CommonUtils.BytesSqlRaw(value as byte[])}";
 | 
				
			||||||
            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
					            if (type == typeof(TimeSpan) || type == typeof(TimeSpan?))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ using System.Collections.Generic;
 | 
				
			|||||||
using System.Data;
 | 
					using System.Data;
 | 
				
			||||||
using System.Data.Common;
 | 
					using System.Data.Common;
 | 
				
			||||||
using System.Data.SQLite;
 | 
					using System.Data.SQLite;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace FreeSql.Sqlite
 | 
					namespace FreeSql.Sqlite
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -100,6 +101,7 @@ namespace FreeSql.Sqlite
 | 
				
			|||||||
        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
					        public override string GetNoneParamaterSqlValue(List<DbParameter> specialParams, Type type, object value)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (value == null) return "NULL";
 | 
					            if (value == null) return "NULL";
 | 
				
			||||||
 | 
					            if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
 | 
				
			||||||
            return FormatSql("{0}", value, 1);
 | 
					            return FormatSql("{0}", value, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user