title: How can generate a sequence number inside a LINQ select?
body: <p>I am getting a hard time generating a sequence number for my list using Linq Select.</p>
  
  <p>I tried to use a normal variable i then increment it inside but it's not working.</p>
  
  <pre><code>var grouped = (from x in jOMACDetails
                         group x by new { x.MAWorkCode, x.ConstructionNumber } into g
                         let f = g.First()
                         select new UtilityReceivingReportDetailEntity
                         {
                             DefaultAccountCode = string.IsNullOrWhiteSpace(f.AccountTitleCode) ? f.AccountTitleName.Trim() : f.AccountTitleCode.Trim(),
                             CompanyID = CurrentContext.CurrentCompanyID,
                             RRNumber = socnumber.Trim(),
                             RRSequenceNumber = (short)???, // &lt;---- Here is the container the I need to be sequence
                             //...............
                         }).AsEnumerable();
  </code></pre>
  
  <p>can someone help me about this?
  thanks in advance</p>