예제 #1
0
 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());
 }
예제 #2
0
        //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());
        }
예제 #3
0
        private OrdersDynamicModel GetOrder(OrdersDynamicModel table, int id)
        {
            var order = GetOrderDynamic(table, id);

            return(new OrdersDynamicModel
            {
                Id = order.Id,
                ProductName = order.ProductName,
                Quantity = order.Quantity,
                Date = order.Date
            });
        }
예제 #4
0
        public List <OrdersDynamicModel> GetOrders(int iteration)
        {
            var listOrders = new List <OrdersDynamicModel>();

            var table = new OrdersDynamicModel();

            for (int i = 1; i <= iteration; i++)
            {
                listOrders.Add(GetOrder(table, i));
            }


            return(listOrders);
        }