mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-15 20:49:31 +08:00
Update .net core project
This commit is contained in:
parent
5a7b5ca8b9
commit
f4422d3a81
@ -34,7 +34,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ErrorMessage.GetThrowMessage("Connection open error . {0}", " 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,实在找不到原因请先Google错误信息:{0}.");
|
||||
return ErrorMessage.GetThrowMessage("Connection open error . {0}", " 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,错误信息:{0}.");
|
||||
}
|
||||
}
|
||||
public static string ExpressionCheck
|
||||
|
@ -117,7 +117,15 @@ namespace SqlSugar
|
||||
{
|
||||
return GetOneToManySql();
|
||||
}
|
||||
else
|
||||
else if (Navigat.NavigatType == NavigateType.Dynamic)
|
||||
{
|
||||
Check.ExceptionEasy(
|
||||
true,
|
||||
" NavigateType.Dynamic no support expression . " + this.ProPertyEntity.Type.Name,
|
||||
" NavigateType.Dynamic 自定义导航对象不支持在Where(x=>x.自定义.Id==1)等方法中使用" + this.ProPertyEntity.Type.Name);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetManyToManySql();
|
||||
}
|
||||
|
@ -70,6 +70,13 @@ namespace SqlSugar
|
||||
{
|
||||
Check.ExceptionEasy(true, " expression error ", "导航查询出错,比如.Count要改成 .Count()");
|
||||
}
|
||||
else if (Navigat.NavigatType == NavigateType.Dynamic)
|
||||
{
|
||||
Check.ExceptionEasy(
|
||||
true,
|
||||
" NavigateType.Dynamic no support expression . "+ this.ProPertyEntity.Type.Name,
|
||||
" NavigateType.Dynamic 自定义导航对象不支持在Where(x=>x.自定义.Id==1)等方法中使用"+ this.ProPertyEntity.Type.Name);
|
||||
}
|
||||
var pk = this.ProPertyEntity.Columns.First(it => it.IsPrimarykey == true).DbColumnName;
|
||||
var name = this.EntityInfo.Columns.First(it => it.PropertyName == Navigat.Name).DbColumnName;
|
||||
var selectName = this.ProPertyEntity.Columns.First(it => it.PropertyName ==MemberName).DbColumnName;
|
||||
|
@ -20,6 +20,7 @@ namespace SqlSugar
|
||||
try
|
||||
{
|
||||
var mySqlConnectionString = base.Context.CurrentConnectionConfig.ConnectionString;
|
||||
Check.ExceptionEasy(String.IsNullOrEmpty(mySqlConnectionString), "ConnectionString is not null", "连接字符串ConnectionString不能为Null");
|
||||
if (!mySqlConnectionString.ToLower().Contains("charset")&& !mySqlConnectionString.ToLower().Contains("character"))
|
||||
{
|
||||
mySqlConnectionString = mySqlConnectionString.Trim().TrimEnd(';') + ";charset=utf8;";
|
||||
@ -28,7 +29,14 @@ namespace SqlSugar
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
if (ex is SqlSugarException)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
return base._DbConnection;
|
||||
|
Loading…
Reference in New Issue
Block a user