Linq Group By
List<InventoryTransferItemModel> itemList = model.InventoryTransferItem;
var master = from i in itemList
group i by new {i.IsConsign, i.StockSysNoA, i.StockSysNoB } into g
select new {
StockSysNoA=g.Key.StockSysNoA,
StockSysNoB=g.Key.StockSysNoB,
result=g.ToList()
};