Group lines with Numeric and AlphaNumeric (LINQ)

101 Views Asked by At

I have a dataset with a column having Numeric and AlphaNumeric Order Nos. Data is being grouped up with different columns which result in merging rows together. Now I want to group lines based on Numeric and AlphaNumeric Order Nos as well, for that purpose I have to evaluate string (data) whether it is Numeric or AlphaNumeric. Following is the statement which groups up data together.

var groupLinesETAFile = (from g in strLinesETAFile
                         group g by new
                         {
                             g.PONo,
                             g.POLineNo,
                             g.POSubLineNo,
                             g.AllocatedPartNo
                         } into grouped
                         select new
                         {
                             PONo = grouped.Key.PONo,
                             POLineNo = grouped.Key.POLineNo,
                             POSubLineNo = grouped.Key.POSubLineNo,
                             AllocatedPartNo = grouped.Key.AllocatedPartNo,
                             ETAQty = grouped.Sum(x => decimal.Parse(x.ETAQty))
                         }).ToList();

Now I want to add a new column in statement "SupplierOrderNo" which has Numeric and AlphaNumeric Values and want to group on Numeric and AlphaNumeric values as well. How can I achieve this with LINQ?

0

There are 0 best solutions below