We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如文档中的例子, 稍微修改下Select函数的参数
var list = db.Queryable<Student, School, Student>((st, sc, st2) => new object[] { JoinType.Left,st.SchoolId==sc.Id, JoinType.Left,st.SchoolId==st2.Id }) .Where((st, sc, st2) => st2.Id == 1 || sc.Id == 1 || st.Id == 1) .OrderBy((sc) => sc.Id) .OrderBy((st,sc)=> st.Name,OrderByType.Desc) .Select((st,sc,st2)=>new { st=st,st2=st2}) .ToList();
在Select里面, 因为st和st2都是Student表,具有相同的实体类名,在执行ToList()时,其中会执行 DataReaderToDictionary方法,循环把DataReader的 <类名.字段名> ,值 添加到字典里面。 能不能想办法换成 <别名.字段名>作为 字段的key,像例子中 <st.Id> <st2.Id> ,这样避免这个异常产生呢?或者, 各位大佬有没有其他解决方案啊?
The text was updated successfully, but these errors were encountered:
同时返回2个一样的实体确实不多见 ,这个功能放在5.X中修复
Sorry, something went wrong.
No branches or pull requests
如文档中的例子, 稍微修改下Select函数的参数
在Select里面, 因为st和st2都是Student表,具有相同的实体类名,在执行ToList()时,其中会执行
DataReaderToDictionary方法,循环把DataReader的 <类名.字段名> ,值 添加到字典里面。
能不能想办法换成 <别名.字段名>作为 字段的key,像例子中 <st.Id> <st2.Id> ,这样避免这个异常产生呢?或者, 各位大佬有没有其他解决方案啊?
The text was updated successfully, but these errors were encountered: