This commit is contained in:
610262374@qq.com
2018-11-24 01:00:00 +08:00
parent 56a3591307
commit 92818130a9
2 changed files with 24 additions and 3 deletions

View File

@@ -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);
}
}

View File

@@ -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中的多表结果集变成单表这样就可以不限制别名一样");
}
}
}