mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
-
This commit is contained in:
@@ -131,7 +131,9 @@ namespace OrmTest.UnitTest
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
if (!ex.Message.Contains("English Message : Join st needs to be the same as Select st1")){
|
||||
throw new Exception("selec t8 error");
|
||||
}
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
@@ -139,11 +141,30 @@ namespace OrmTest.UnitTest
|
||||
{
|
||||
|
||||
var t8 = db.Queryable<Student, School>((st, sc) =>st.Id==sc.Id).Where(st => st.Id > 0)
|
||||
.Select<School>((st1) => new School() { Id = st1.Id }).ToList();
|
||||
.Where(x=>x.Id==1)
|
||||
.Select<School>((st) => new School() { Id = st.Id }).ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
if (!ex.Message.Contains("English Message : Join st needs to be the same as Where x")){
|
||||
throw new Exception("selec t8 error");
|
||||
}
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var t8 = db.Queryable<Student, School>((st, sc) => st.Id == sc.Id)
|
||||
.Sum(x =>x.Id );
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
if (!ex.Message.Contains("English Message : Join st needs to be the same as Sum x")){
|
||||
throw new Exception("selec t8 error");
|
||||
}
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ErrorMessage.GetThrowMessage("Join {0} needs to be the same as {1} {2}", "别名不一致错误,{1}中的{2}需要和Join {0}中的名称一致,特殊需求可以使用.Select((x,y)=>new{{ id=x.id,name=y.name}}).MergeTable().Orderby(xxx=>xxx.Id)功能将Select中的多表结果集变成单表,这样就可以不限制别名一样");
|
||||
return ErrorMessage.GetThrowMessage("Join {0} needs to be the same as {1} {2}", "多表查询中表达式别名不一致,{1}中的 {2} 需要和 Join中的 {0} 名称一致,请把{1}中的{2}改成{0},特殊需求可以使用.Select((x,y)=>new{{ id=x.id,name=y.name}}).MergeTable().Orderby(xxx=>xxx.Id)功能将Select中的多表结果集变成单表,这样就可以不限制别名一样");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user