From cf71763d5381d6fe6d14c824b5a8a72f7f321399 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 17 Jul 2017 12:24:29 +0800 Subject: [PATCH] - --- .../Abstract/DbBindProvider/IDataReaderEntityBuilder.cs | 4 ++++ Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/IDbMethods.cs | 1 + Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs index ce80a3768..cfdef3de8 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs @@ -222,6 +222,10 @@ namespace SqlSugar method = isNullableType ? getConvertInt32 : getInt32; if (bindProperyTypeName.IsContainsIn("int64")) method = isNullableType ? getConvertInt64 : getInt64; + if (bindProperyTypeName.IsContainsIn("byte")) + method = isNullableType ? getConvertByte : getByte; + if (bindProperyTypeName.IsContainsIn("int16")) + method = isNullableType ? getConvertInt16 : getInt16; break; case CSharpDataType.@bool: if (bindProperyTypeName == "bool" || bindProperyTypeName == "boolean") diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/IDbMethods.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/IDbMethods.cs index 0e6cca3ce..9a9e63d55 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/IDbMethods.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/IDbMethods.cs @@ -47,6 +47,7 @@ namespace SqlSugar string AggregateMax(MethodCallExpressionModel model); string AggregateCount(MethodCallExpressionModel model); string MappingColumn(MethodCallExpressionModel model); + string GetSelfAndAutoFill(MethodCallExpressionModel model); string True(); string False(); string GuidNew(); diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs index df845d243..82e5b2fa5 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Method/SqlFunc.cs @@ -95,5 +95,12 @@ namespace SqlSugar public static TResult AggregateMax(TResult thisValue) { throw new NotSupportedException("This method is not supported by the current parameter"); } public static TResult AggregateCount(TResult thisValue) { throw new NotSupportedException("This method is not supported by the current parameter"); } public static TResult MappingColumn(TResult oldColumnName,string newColumnName) { throw new NotSupportedException("This method is not supported by the current parameter"); } + /// + ///Example: new NewT(){name=SqlFunc.GetSelfAndAutoFill(it)} Generated SQL it.* + /// + /// + /// + /// + public static TResult GetSelfAndAutoFill(object value) { throw new NotSupportedException("This method is not supported by the current parameter"); } } }