Example #1
0
        public ApplicationServiceResponse GetAllOrders()
        {
            var orders = _orderBusiness.GetAllOrders();
            var model  = _mapper.Map <IEnumerable <OrderManagementViewModel> >(orders);

            return(Ok(model.ToList()));
        }
Example #2
0
        public async Task <IHttpActionResult> GetAllOrders(string date, int skip = 0, int limit = 10)
        {
            if (skip < 0 || limit < 1 || string.IsNullOrWhiteSpace(date))
            {
                return(BadRequest("Invalid pagination data."));
            }
            var response = await _orderBusiness.GetAllOrders(date, skip, limit);

            if (response == null)
            {
                return(Ok(new GenericResponse <string>(false, null, "No order found.")));
            }
            return(Ok(new GenericResponse <List <OrderListItemViewModel> >(true, response)));
        }
 // GET: api/Order
 public IEnumerable <IOrder> Get()
 {
     return(orderBusiness.GetAllOrders());
 }