5
아래의 코드를 참조하십시오. 주문이 작동하지 않는 이유는 모르겠지만 어떤 아이디어입니까?익명 형식의 IEnumerable <T>을 주문하는 방법은 무엇입니까?
var orderSample = new { ProductName = "", Qty = 0, UserFullName = "" };
var ordersList = (new[] { orderSample }).ToList();
//loop thru another collection and fill ordersList by adding an order at a time
ordersList.Add(new { ProductName = "Product1", Qty = 5, UserFullName = "Mr. Smith" });
//sort the orders by name - DOESN'T WORK
ordersList.OrderBy(p => p.ProductName);
gvReport3.DataSource = ordersList;
gvReport3.DataBind();
감사합니다. 훌륭한 작품입니다! –