private dynamic GetOrderDynamic(OrdersDynamicModel table, int id) { return(table.Query(@"SELECT [WorkOrderID] AS Id, P.Name AS ProductName, [OrderQty] AS Quantity, [DueDate] AS Date FROM [AdventureWorks2014].[Production].[WorkOrder] AS WO INNER JOIN[Production].[Product] AS P ON P.ProductID = WO.ProductID WHERE WorkOrderID = @0", id).FirstOrDefault()); }
//1 itération public List <dynamic> GetOrdersDynamic() { var table = new OrdersDynamicModel(); return(table.Query(@"SELECT TOP 500 [WorkOrderID] AS Id, P.Name AS ProductName, [OrderQty] AS Quantity, [DueDate] AS Date FROM [AdventureWorks2014].[Production].[WorkOrder] AS WO INNER JOIN[Production].[Product] AS P ON P.ProductID = WO.ProductID").ToList()); }