I use the Northwind database and Lightspeed 4.0.1822.22414 (latest nightly). I use this query:
var data = from product in uow.Products
join category in uow.Categories on product.CategoryId equals category.Id
join order in uow.OrderDetails on product.Id equals order.ProductId
group order by new { product.ProductName, category.CategoryName } into groups
select groups;
I get the following exception:
LightspeedTest.JoinOrderGroup2 : FailedTest method Northwind.Tests.LightspeedTest.JoinOrderGroup2 threw exception:
System.Data.SqlClient.SqlException: Invalid column name 'Id'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, ref Boolean dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, ref Task task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, ref Task task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at ...()
at Mindscape.LightSpeed.Profiling.Interceptor.ExecuteCommand(Func`1 baseExecutor, IUnitOfWork unitOfWork, IDbCommand command)
at ..(IUnitOfWork , IDbCommand , Func`1 )
at ..(IUnitOfWork , IDbCommand )
at ...ctor(IUnitOfWork, IEnumerable`1)
at Mindscape.LightSpeed.Data.DataProviderAdapter.(IUnitOfWork , IEnumerable`1 , ProviderOptions )
at ..(List`1 , Query , EntityTuple )
at ..(Query , EntityTuple )
at Mindscape.LightSpeed.UnitOfWork.FindGroup(Query query, EntityTuple results)
at Mindscape.LightSpeed.UnitOfWorkBase.Find(Query query, EntityMap typeMap)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GetAllGroupsAtOnce(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, List`1 groupingOn, GroupResultsTypeHandler handler)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.FetchResultSetForMultipleGroupingKeys(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, GroupResultsTypeHandler handler)
at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType)
at Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression)
at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression)
at Mindscape.LightSpeed.Linq.LinqQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList(IEnumerable`1 source)
at Northwind.Tests.LightspeedTest.JoinOrderGroup2() in LightspeedTest.cs: line 274