Beispiel #1
0
        private static void SingleRequest()
        {
            var client             = new GithubClient();
            var usersService       = new UsersService(client);
            var pullRequestService = new PullRequestService(client);
            var controller         = new UsersController(usersService, pullRequestService);

            controller.Print();
            controller.Print();
            controller.Print();
        }
Beispiel #2
0
        private static void SingletonMultipleRequests()
        {
            var client             = new GithubClient();
            var usersService       = new UsersService(client);
            var pullRequestService = new PullRequestService(client);

            // requests - scope
            {
                var controller = new UsersController(usersService, pullRequestService);
                controller.Print();
            }

            // requests - scope
            {
                var controller = new UsersController(usersService, pullRequestService);
                controller.Print();
            }
        }