public async Task <IActionResult> Index(int id = 1) { var listOfBars = new BarsListViewModel(); listOfBars.Paging.Count = await barServices.AllBarsCountAsync(); listOfBars.Paging.ItemsPerPage = itemsPerPage; listOfBars.Paging.CurrentPage = id; listOfBars.AllBars = (await barServices.GetAllDTOAsync(listOfBars.Paging.ItemsPerPage, listOfBars.Paging.CurrentPage)) .Select(c => c.MapToViewModel()); return(View(listOfBars)); }