Browse Source

Update Core

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
dd749d890e
  1. 2
      Src/Asp.Net/SqlSugar/SqlSugar.nuspec
  2. 2
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs
  3. 9
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs
  4. 4
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbFirstProvider/DbFirstTemplate.cs
  5. 66
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  6. 4
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Properties/AssemblyInfo.cs
  7. 5
      Src/Asp.NetCore/SqlServerTest/src/SqlSugar/SqlSugarForCore.nuspec

2
Src/Asp.Net/SqlSugar/SqlSugar.nuspec

@ -2,7 +2,7 @@
<package >
<metadata>
<id>sqlSugar</id>
<version>4.2</version>
<version>4.2.0.1</version>
<title>SqlSugar SqlServer ORM</title>
<authors>sun kaixuan</authors>
<owners>landa</owners>

2
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs

@ -108,7 +108,7 @@ namespace SqlSugar
{
if (!ReaderKeys.Contains(mappInfo.DbColumnName))
{
fileName = ReaderKeys.Single(it=>it.Equals(mappInfo.DbColumnName,StringComparison.CurrentCultureIgnoreCase));
fileName = ReaderKeys.Single(it => it.Equals(mappInfo.DbColumnName, StringComparison.CurrentCultureIgnoreCase));
}
else
{

9
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbFirstProvider/DbFirstProvider.cs

@ -162,6 +162,7 @@ namespace SqlSugar
foreach (var item in columns)
{
var isLast = columns.Last() == item;
var index = columns.IndexOf(item);
string PropertyText = this.PropertyTemplate;
string PropertyDescriptionText = this.PropertyDescriptionTemplate;
string propertyName = GetPropertyName(item);
@ -172,8 +173,9 @@ namespace SqlSugar
classText = classText.Replace(DbFirstTemplate.KeyPropertyName, PropertyText + (isLast ? "" : ("\r\n" + DbFirstTemplate.KeyPropertyName)));
if (ConstructorText.IsValuable() && item.DefaultValue.IsValuable())
{
var hasDefaultValue = columns.Skip(index + 1).Any(it=>it.DefaultValue.IsValuable());
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyPropertyName, propertyName);
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (isLast ? "" : this.ConstructorTemplate);
ConstructorText = ConstructorText.Replace(DbFirstTemplate.KeyDefaultValue, GetPropertyTypeConvert(item)) + (!hasDefaultValue ? "" : this.ConstructorTemplate);
}
}
}
@ -289,7 +291,10 @@ namespace SqlSugar
private string GetPropertyTypeConvert(DbColumnInfo item)
{
var convertString = GetProertypeDefaultValue(item);
if (convertString == "DateTime.Now" || convertString == null) return convertString;
if (convertString == "DateTime.Now" || convertString == null)
return convertString;
if (item.DataType == "bit")
return (convertString == "1" || convertString.Equals("true",StringComparison.CurrentCultureIgnoreCase)).ToString().ToLower();
string result = this.Context.Ado.DbBind.GetConvertString(item.DataType) + "(\"" + convertString + "\")";
return result;
}

4
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/DbFirstProvider/DbFirstTemplate.cs

@ -12,9 +12,9 @@ namespace SqlSugar
"namespace {Namespace}\r\n" +
"{\r\n" +
"{ClassDescription}{SugarTable}\r\n" +
ClassSpace+"public class {ClassName}\r\n" +
ClassSpace+ "public partial class {ClassName}\r\n" +
ClassSpace + "{\r\n" +
PropertySpace + "public {ClassName}(){\r\n" +
PropertySpace + "public {ClassName}(){\r\n\r\n" +
"{Constructor}\r\n" +
PropertySpace + "}\r\n" +
"{PropertyName}\r\n" +

66
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -793,18 +793,18 @@ namespace SqlSugar
#region Order
public ISugarQueryable<T, T2, T3> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression,type);
return this;
}
public ISugarQueryable<T, T2, T3> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public new ISugarQueryable<T, T2, T3> OrderBy(Expression<Func<T, object>> expression, OrderByType type)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion
@ -980,22 +980,22 @@ namespace SqlSugar
#region OrderBy
public new ISugarQueryable<T, T2, T3, T4> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4> OrderBy(Expression<Func<T, T2, T3, T4, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion
@ -1144,27 +1144,27 @@ namespace SqlSugar
#region OrderBy
public new ISugarQueryable<T, T2, T3, T4, T5> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> OrderBy(Expression<Func<T, T2, T3, T4, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> OrderBy(Expression<Func<T, T2, T3, T4, T5, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion
@ -1334,32 +1334,32 @@ namespace SqlSugar
#region OrderBy
public new ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, T2, T3, T4, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, T2, T3, T4, T5, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion
@ -1550,37 +1550,37 @@ namespace SqlSugar
#region OrderBy
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, T3, T4, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, T3, T4, T5, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, T7, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion
@ -1793,42 +1793,42 @@ namespace SqlSugar
#region OrderBy
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, T4, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, T4, T5, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, T7, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> OrderBy(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, object>> expression, OrderByType type = OrderByType.Asc)
{
_OrderBy(expression);
_OrderBy(expression, type);
return this;
}
#endregion

4
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Properties/AssemblyInfo.cs

@ -17,5 +17,5 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1c022a5c-4e4d-4026-a8a3-f659b9740a1a")]
[assembly: AssemblyVersion("4.2")]
[assembly: AssemblyFileVersion("4.2")]
[assembly: AssemblyVersion("4.2.0.1")]
[assembly: AssemblyFileVersion("4.2.0.1")]

5
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/SqlSugarForCore.nuspec

@ -2,7 +2,7 @@
<package >
<metadata>
<id>sqlSugarCore</id>
<version>4.2</version>
<version>4.2.0.1</version>
<authors>sunkaixuan</authors>
<owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
@ -20,7 +20,8 @@
<dependency id="System.Collections.NonGeneric" version="4.0.1" />
<dependency id="System.Dynamic.Runtime" version="4.0.11" />
<dependency id="System.Reflection.Emit.Lightweight" version="4.0.1" />
<dependency id="System.Runtime.Loader" version="4.0.0" />
<dependency id="System.Runtime.Loader" version="4.0.0" />
<dependency id="Microsoft.Data.Sqlite" version="1.0.0" />
</group>
</dependencies>
</metadata>

Loading…
Cancel
Save