I have a domain entity called "HoldItems" and i created a list of HoldItems object.
All the attribute on that HoldItems are:
public int TransactionNo;
public int TransactionID;
public int ItemNo;
public String ItemName;
public int Qty;
public double Price;
public double TotalPrice;
public double DiscountPrice;
public int ItemType;
public bool VatInclude;
public double VatPrice;
public string Note;
public List<HoldExtraMenu> ExtraMenuList;
public string BelongCategoryName;
public int BelongItemNo;
public int BelongItemIndex;
public int BelongCategoryID;
I wrote some LINQ query like this, that selectedItemList represent List<DomainEntities.HoldItems>
var results = from myobject in selectedItemList
where myobject.ItemType == 5
where myobject.BelongItemIndex==selectedItemList.IndexOf(C)
orderby myobject.BelongCategoryName
select myobject;
Now the question is, I need to group this result by BelongCategoryName and concatenate output column for ItemName using add ","