mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-04 04:37:58 +08:00
Update Nuget
This commit is contained in:
parent
fcf85ec3c8
commit
bac591052b
BIN
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Lib/SqlSugar.dll
Normal file
BIN
Src/Asp.NetCore/SqlServerTest/src/SqlSugar/Lib/SqlSugar.dll
Normal file
Binary file not shown.
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlDbBind : DbBindProvider
|
||||
{
|
||||
public override List<KeyValuePair<string, CSharpDataType>> MappingTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar.Realization.MySql
|
||||
{
|
||||
public partial class DbType
|
||||
{
|
||||
public const string MySql = "MySql";
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
//using System;
|
||||
//using System.Data;
|
||||
//using System.Data.SqlClient;
|
||||
//using MySql.Data.MySqlClient;
|
||||
|
||||
//namespace SqlSugar
|
||||
//{
|
||||
// public class MySqlProvider : AdoProvider
|
||||
// {
|
||||
// public MySqlProvider() {}
|
||||
// public override IDbConnection Connection
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// if (base._DbConnection == null)
|
||||
// {
|
||||
// base._DbConnection = new MySqlConnection(base.Context.CurrentConnectionConfig.ConnectionString);
|
||||
// }
|
||||
// return base._DbConnection;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// base._DbConnection = value;
|
||||
// }
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// Only SqlServer
|
||||
// /// </summary>
|
||||
// /// <param name="transactionName"></param>
|
||||
// public override void BeginTran(string transactionName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// Only SqlServer
|
||||
// /// </summary>
|
||||
// /// <param name="iso"></param>
|
||||
// /// <param name="transactionName"></param>
|
||||
// public override void BeginTran(IsolationLevel iso, string transactionName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// public override IDataAdapter GetAdapter()
|
||||
// {
|
||||
// return new MySqlDataAdapter();
|
||||
// }
|
||||
// public override IDbCommand GetCommand(string sql, SugarParameter[] parameters)
|
||||
// {
|
||||
// MySqlCommand sqlCommand = new MySqlCommand(sql, (MySqlConnection)this.Connection);
|
||||
// sqlCommand.CommandType = this.CommandType;
|
||||
// sqlCommand.CommandTimeout = this.CommandTimeOut;
|
||||
// if (this.Transaction != null)
|
||||
// {
|
||||
// sqlCommand.Transaction = (MySqlTransaction)this.Transaction;
|
||||
// }
|
||||
// if (parameters.IsValuable())
|
||||
// {
|
||||
// IDataParameter[] ipars= ToIDbDataParameter(parameters);
|
||||
// sqlCommand.Parameters.AddRange((SqlParameter[])ipars);
|
||||
// }
|
||||
// CheckConnection();
|
||||
// return sqlCommand;
|
||||
// }
|
||||
// public override void SetCommandToAdapter(IDataAdapter dataAdapter, IDbCommand command)
|
||||
// {
|
||||
// ((MySqlDataAdapter)dataAdapter).SelectCommand = (MySqlCommand)command;
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// if mysql return MySqlParameter[] pars
|
||||
// /// if sqlerver return SqlParameter[] pars ...
|
||||
// /// </summary>
|
||||
// /// <param name="parameters"></param>
|
||||
// /// <returns></returns>
|
||||
// public override IDataParameter[] ToIDbDataParameter(params SugarParameter[] parameters)
|
||||
// {
|
||||
// if (parameters == null || parameters.Length == 0) return null;
|
||||
// SqlParameter[] result = new SqlParameter[parameters.Length];
|
||||
// int i = 0;
|
||||
// foreach (var paramter in parameters)
|
||||
// {
|
||||
// if (paramter.Value == null) paramter.Value = DBNull.Value;
|
||||
// var p = new SqlParameter();
|
||||
// p.ParameterName = paramter.ParameterName;
|
||||
// p.UdtTypeName = paramter.UdtTypeName;
|
||||
// p.Size = paramter.Size;
|
||||
// p.Value = paramter.Value;
|
||||
// p.DbType = paramter.DbType;
|
||||
// p.Direction = paramter.Direction;
|
||||
// result[i] =p;
|
||||
// ++i;
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -1,35 +0,0 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlQueryable<T>:QueryableProvider<T>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T,T2> : QueryableProvider<T,T2>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2,T3> : QueryableProvider<T, T2,T3>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2,T3,T4> : QueryableProvider<T, T2,T3,T4>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2, T3, T4, T5> : QueryableProvider<T, T2, T3, T4, T5>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2, T3, T4, T5, T6> : QueryableProvider<T, T2, T3, T4, T5, T6>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2, T3, T4, T5, T6, T7> : QueryableProvider<T, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
|
||||
}
|
||||
public class MySqlQueryable<T, T2, T3, T4, T5, T6, T7, T8> : QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlBuilder : SqlBuilderProvider
|
||||
{
|
||||
|
||||
public override string GetTranslationTableName(string name)
|
||||
{
|
||||
Check.ArgumentNullException(name, string.Format(ErrorMessage.ObjNotExist, "Table Name"));
|
||||
var context = this.Context;
|
||||
var mappingInfo = context
|
||||
.MappingTables
|
||||
.FirstOrDefault(it => it.EntityName.Equals(name, StringComparison.CurrentCultureIgnoreCase));
|
||||
return "`" + (mappingInfo == null ? name : mappingInfo.DbTableName) + "`";
|
||||
}
|
||||
public override string GetTranslationColumnName(string entityName, string propertyName)
|
||||
{
|
||||
Check.ArgumentNullException(entityName, string.Format(ErrorMessage.ObjNotExist, "Table Name"));
|
||||
Check.ArgumentNullException(propertyName, string.Format(ErrorMessage.ObjNotExist, "Column Name"));
|
||||
var context = this.Context;
|
||||
var mappingInfo = context
|
||||
.MappingColumns
|
||||
.FirstOrDefault(it =>
|
||||
it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase) &&
|
||||
it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
||||
return (mappingInfo == null ? "`" + propertyName + "`" : "`" + mappingInfo.DbColumnName + "`");
|
||||
}
|
||||
|
||||
public override string GetTranslationColumnName(string propertyName)
|
||||
{
|
||||
return "`" + propertyName + "`";
|
||||
}
|
||||
|
||||
public override string GetNoTranslationColumnName(string name)
|
||||
{
|
||||
return name == null ? string.Empty : Regex.Match(name, @"\`(.*?)\`").Groups[1].Value;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlDeleteBuilder : DeleteBuilder
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlExpressionContext : ExpressionContext, ILambdaExpressions
|
||||
{
|
||||
public SqlSugarClient Context { get; set; }
|
||||
public MySqlExpressionContext()
|
||||
{
|
||||
base.DbMehtods = new MySqlMethod();
|
||||
}
|
||||
|
||||
}
|
||||
public class MySqlMethod : DefaultDbMethod, IDbMethods
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlInsertBuilder : InsertBuilder
|
||||
{
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public partial class MySqlQueryBuilder : QueryBuilder
|
||||
{
|
||||
#region Sql Template
|
||||
public override string PageTempalte
|
||||
{
|
||||
get
|
||||
{
|
||||
/*
|
||||
SELECT * FROM TABLE WHERE CONDITION ORDER BY ID DESC LIMIT 0,10
|
||||
*/
|
||||
var template = "SELECT {0} FROM {1} {2} {3} {4} LIMIT {5},{6}";
|
||||
return template;
|
||||
}
|
||||
}
|
||||
public override string DefaultOrderByTemplate
|
||||
{
|
||||
get
|
||||
{
|
||||
return "ORDER BY NOW() ";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Common Methods
|
||||
|
||||
public override string ToSqlString()
|
||||
{
|
||||
sql = new StringBuilder();
|
||||
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString);
|
||||
if (IsCount) { return sql.ToString(); }
|
||||
if (Skip != null && Take == null)
|
||||
{
|
||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString, Skip.ObjToInt() + 1, long.MaxValue);
|
||||
}
|
||||
else if (Skip == null && Take != null)
|
||||
{
|
||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, 1, Take.ObjToInt());
|
||||
}
|
||||
else if (Skip != null && Take != null)
|
||||
{
|
||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||
return string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, Skip.ObjToInt() > 0 ? Skip.ObjToInt() + 1 : 0, Take);
|
||||
}
|
||||
else
|
||||
{
|
||||
return sql.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get SQL Partial
|
||||
public override string GetSelectValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.IsCount) return "COUNT(1) AS `Count` ";
|
||||
string reval = string.Empty;
|
||||
if (this.SelectValue == null || this.SelectValue is string)
|
||||
{
|
||||
reval = GetSelectValueByString();
|
||||
}
|
||||
else
|
||||
{
|
||||
reval = GetSelectValueByExpression();
|
||||
}
|
||||
if (this.SelectType == ResolveExpressType.SelectMultiple)
|
||||
{
|
||||
this.SelectCacheKey = this.SelectCacheKey + string.Join("-", this.JoinQueryInfos.Select(it => it.TableName));
|
||||
}
|
||||
return reval;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class MySqlUpdateBuilder : UpdateBuilder
|
||||
{
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>sqlSugarCore</id>
|
||||
<version>4.0.0.2</version>
|
||||
<version>4.0.0.3</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>Landa</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
@ -20,12 +20,11 @@
|
||||
<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" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\Src\Asp.NetCore\SqlServerTest\src\SqlSugar\bin\Debug\netstandard1.6\SqlSugar.dll"></file>
|
||||
<file src="F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\Src\Asp.NetCore\SqlServerTest\src\SqlSugar\bin\Debug\netstandard1.6\SqlSugar.dll" target="lib\netstandard1.6"></file>
|
||||
</files>
|
||||
</package>
|
Loading…
Reference in New Issue
Block a user