public GetOrdersResponse GetOrdersByCriteria(GetOrdersRequest request)
        {
            GetOrdersResponse response = new GetOrdersResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();

            IQueryable<Order> orders = bc.GetOrdersByCriteria(request.SearchType, request.CustomerId);
            response.Orders = OrderAdapter.OrdersToListDtos(orders);

            return response;
        }
        public GetOrdersResponse GetOrdersByCriteria(GetOrdersRequest request)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                throw new FaultException<NotAuthenticatedFault>(new NotAuthenticatedFault());
            GetOrdersResponse response = new GetOrdersResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();            
            IQueryable<Order> orders = bc.GetOrdersByCriteria(request.SearchType, request.CustomerId);
            response.Orders = OrderAdapter.OrdersToListDtos(orders);

            return response; ;
        }
        public void TestGetOrders()
        {
            int orderId = 1;
            GetOrdersResponse response = new GetOrdersResponse();
            response.Orders.Add(new OrderListDTO() {Id = orderId});

            Expect.Once.On(service).Method("GetOrdersByCriteria").Will(Return.Value(response));
            IList<OrderListDTO> orders = serviceFacade.GetOrdersByCustomer(orderId);
            Assert.AreEqual(1, orders.Count);
            Assert.AreEqual(orders.First().Id, orderId);

            Expect.Once.On(service).Method("GetOrdersByCriteria").Will(Return.Value(response));
            orders = serviceFacade.GetAllOrders();
            Assert.AreEqual(1, orders.Count);
            Assert.AreEqual(orders.First().Id, orderId);
        }