コード例 #1
0
ファイル: OrderService.cs プロジェクト: vebin/DapperContext
        public Order CreateOrder(Customer customer)
        {
            if (customer == null)
                customer = GetDefaultCustomer();

            return new Order
            {
                CustomerID = customer.CustomerID,
                OrderDate = DateTime.Now,
                Lines = new List<OrderLine>()
            };
        }
コード例 #2
0
 public IEnumerable<Order> GetCustomerOrders(Customer customer)
 {
     return CreateContext().Query<Order>("SELECT * FROM Orders WHERE CustomerID = @CustomerID", new {customer.CustomerID});
 }