Skip to main content
Typo, clarification
Source Link
p.s.w.g
  • 149.6k
  • 31
  • 307
  • 338

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you'reyour goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

Or in query syntax:

(from t in SFC.OrderFormModifiedMonitoringRecords
 orderby t.DateModify, t.TimeModify
 select new { RowID = t.rowID, OFnum = t.OFNo })
.Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct itemspairs of values.

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you're goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

Or in query syntax:

(from t in SFC.OrderFormModifiedMonitoringRecords
 orderby t.DateModify, t.TimeModify
 select new { RowID = t.rowID, OFnum = t.OFNo })
.Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct items.

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what your goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

Or in query syntax:

(from t in SFC.OrderFormModifiedMonitoringRecords
 orderby t.DateModify, t.TimeModify
 select new { RowID = t.rowID, OFnum = t.OFNo })
.Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo and return only distinct pairs of values.

added 193 characters in body
Source Link
p.s.w.g
  • 149.6k
  • 31
  • 307
  • 338

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you're goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

Or in query syntax:

(from t in SFC.OrderFormModifiedMonitoringRecords
 orderby t.DateModify, t.TimeModify
 select new { RowID = t.rowID, OFnum = t.OFNo })
.Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct items.

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you're goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct items.

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you're goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

Or in query syntax:

(from t in SFC.OrderFormModifiedMonitoringRecords
 orderby t.DateModify, t.TimeModify
 select new { RowID = t.rowID, OFnum = t.OFNo })
.Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct items.

Source Link
p.s.w.g
  • 149.6k
  • 31
  • 307
  • 338

The delegate you pass to SelectMany must return an IEnumerable and is for collapsing multiple collections into one. So yes, something's definitely wrong here. I think you've confused it with Select which simply maps one collection to another.

Without knowing what you're goal is, it's hard to know exactly how to fix it, but I'm guessing you want something like this:

SFC.OrderFormModifiedMonitoringRecords
   .OrderBy(t => t.DateModify)
   .ThenBy(t => t.TimeModify)
   .Select(t => new { RowID = t.rowID, OFnum = t.OFNo })
   .Distinct();

This will order the records by DateModify then by TimeModify, select two properties, rowID and OFNo, and return only distinct items.