Exemplo n.º 1
0
        public IEnumerable <Order> FindAllCustomersOrdersBy(Guid customerId)
        {
            IEnumerable <Order> customerOrders = new List <Order>();

            Query query = new Query();

            //字符串
            //query.Add(new Criterion("CustomerId", customerId, CriteriaOperator.Equal));

            //Lambda
            query.Add(Criterion.Createe <Order>(o => o.CustomerId, customerId, CriteriaOperator.Equal));

            query.OrderByProperty = new OrderByClause("CustomerId", true);

            customerOrders = _orderRepository.FindBy(query);


            return(customerOrders);
        }