I fetch data from 2 tables (Log and LogEvent) into my entity collection (of LogEvents) and sort using data from multiple tables. The sort expression (sort on Log.Date first and LogEvent.Sequence next) works fine on the entity collection.
Then I create a EntityView2 with same sort expression but the view is not sorted right. It sorts only on the LogEvent.Sequence and not the Log.Date field.
ISortExpression logOrder = new SortExpression();
logOrder.Add(LogFields.Date | SortOperator.Ascending);
logOrder.Add(LogEventFields.Sequence | SortOperator.Ascending);
m_EventColln = new EntityCollection<DbLogEvent>(new DbLogEventFactory());
adapter.FetchEntityCollection(m_EventColln, relBucket, FETCH_ALL, logOrder, fetchPath);
m_EventView = new EntityView2<DbLogEvent>(m_EventColln, logOrder);
Is it not possible to sort the view based on both the table columns? Is there a workaround if this is not possible?