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(); }
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(); } }