static void Main(string[] args)
        {
            Console.WriteLine("Proccess Starting...");
            Console.ReadLine();

            var residentFilterParams = new ResidentsFilterParams();

            AuthenticationService.Authorize(new Model.CurrentUserViewModel
            {
                Email    = "*****@*****.**",
                Password = "******"
            });

            var resientsResult = ResidentService.GetResidents(residentFilterParams);

            GenereteObservations(resientsResult.Collection);

            var totalPages = Math.Ceiling((double)resientsResult.TotalCount / residentFilterParams.Take);

            for (var i = 1; i <= totalPages; i++)
            {
                residentFilterParams.Skip = residentFilterParams.Take * (i - 1);

                var residents = ResidentService.GetResidents(residentFilterParams);
                GenereteObservations(residents.Collection);
            }

            Console.WriteLine("Press enter to stop proccess...");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        public IHttpActionResult Get()
        {
            ResidentService residentService = CreateResidentService();
            var             residents       = residentService.GetResidents();

            return(Ok(residents));
        }