我有以下 SQL 语句
select RegionBoundaryID, RegionBoundary.lat, RegionBoundary.long, RegionID
from RegionBoundary join Region_Boundary on RegionBoundary.RegionBoundaryID = Region_Boundary.BoundaryID
order by RegionID, RegionBoundaryID
这是它对 LINQ 的翻译
var context = new DataClassesRegionDataContext();
var regionBoudaries = from boundaryID in context.Region_Boundaries
join boundariesDetail in context.RegionBoundaries on boundaryID.BoundaryID equals boundariesDetail.RegionBoundaryID
select new RegionViewModel { ID = boundariesDetail.RegionBoundaryID, Latitude = boundariesDetail.lat.Value, Longitude = boundariesDetail.@long.Value, RegionID = boundaryID.RegionID };
regionBoudaries.OrderBy(region => region.RegionID).ThenBy(region => region.ID);
但是,我从 LINQ 得到的结果与 SQL 语句的结果不同。我在 LINQ 语句中哪里错了?谢谢你。
编辑:不同之处在于我的结果出现的顺序