Exemplo n.º 1
0
        public async Task <List <CustomerProductSingleViewModel> > GetAssignedProductsApi(int customerID)
        {
            List <CustomerProductSingleViewModel> cpList = new List <CustomerProductSingleViewModel>();
            IEnumerable <CustomerProduct>         result = await customerProductRepository.FindCustomerProductsByCustomerIDAsync(customerID);

            result = result.OrderBy(s => s.Product.FullName.ToUpper());

            foreach (CustomerProduct item in result)
            {
                cpList.Add(new Models.CustomerProductSingleViewModel(item));
            }
            return(cpList);
        }