Пример #1
0
        public async Task <IActionResult> OnGetOrderPartial(int orderby, int filterby, int filterEQ, string number, string query)
        {
            Shop = new List <Shop>(await _shopRepository.GetAllShopsAsync());
            if (!string.IsNullOrEmpty(query))
            {
                Shop = ShopService.ShopByQuery(Shop, query);
            }
            currentUser = await _userManager.GetUserAsync(User);

            if (currentUser != null)
            {
                currentUser = await _userRepository.GetUserAsync(currentUser.Id);

                userCoordinate = currentUser.Coordinate;
            }
            Shop = ShopService.DoSort(Shop, orderby, query, userCoordinate);
            Shop = ShopService.DoFilter(Shop, filterby, filterEQ, number, query, userCoordinate);
            var converted = JsonConvert.SerializeObject(Shop);

            return(new JsonResult(converted));
        }