Exemplo n.º 1
0
        public async Task <GetListDataResponse <ProductDTO> > GetProductList(int index, int count)
        {
            var response = new GetListDataResponse <ProductDTO>();

            response.Model = await(from product in _sqlServerContext.Product

                                   select new ProductDTO
            {
                CompanyPercentage = product.CompanyPercentage
            }
                                   ).ToListAsync();
            return(response);
        }
Exemplo n.º 2
0
        public async Task <GetListDataResponse <CustomerDTO> > GetCustomerList(int index, int count)
        {
            var response = new GetListDataResponse <CustomerDTO>();

            response.TotalCount = 10;
            response.Model      = await(from customer in _sqlServerContext.Customer

                                        select new CustomerDTO
            {
                Name = customer.Name
            }).ToListAsync();
            return(response);
        }
Exemplo n.º 3
0
        public async Task <GetListDataResponse <OrderDTO> > GetOrderList(int index, int count)
        {
            var response = new GetListDataResponse <OrderDTO>();

            response.Model = await(from order in _sqlServerContext.Order

                                   select new OrderDTO
            {
                OrderId = order.OrderId
            }
                                   ).ToListAsync();
            return(response);
        }
Exemplo n.º 4
0
        public async Task <GetListDataResponse <EmployeeDTO> > GetEmployeeList(int index, int count)
        {
            var response = new GetListDataResponse <EmployeeDTO>();

            response.TotalCount = 10;
            response.Model      = (from employee in _sqlServerContext.Employee

                                   select new EmployeeDTO
            {
                Name = employee.Name
            }).ToList();
            return(response);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> GetProductList(int Index, int Count)
        {
            var response = new GetListDataResponse <ProductDTO>();

            try
            {
                response = await _productService.GetProductList(Index, Count);
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = "There was an internal error, please contact to technical support.";
            }
            return(Ok(response));
        }