static void Main(string[] args) { Console.WriteLine("Press enter to start proccessing ..."); Console.ReadLine(); var rentFilterParams = new RentsFilterParams(); AuthenticationService.Authorize(new Model.CurrentUserViewModel { Email = "*****@*****.**", Password = "******" }); var rentsResult = RentService.GetRents(rentFilterParams); UpdateRents(rentsResult.Collection); var totalPages = Math.Ceiling((double)rentsResult.TotalCount / rentFilterParams.Take); for (var i = 2; i <= totalPages; i++) { rentFilterParams.Skip = rentFilterParams.Take * (i - 1); var rents = RentService.GetRents(rentFilterParams); UpdateRents(rents.Collection); } }