public static async Task RunNewsTweeter(MongoDbCredentials credentials) { DatabaseFactory databaseFactory = DatabaseFactory.Init(credentials); NewsDatabase newsDatabase = NewsDatabase.Init(databaseFactory); await RunNewsTweeter(); }
public static NewsDatabase Init(DatabaseFactory databaseFactory) { if (_instance == null) { lock (_instanceLock) { if (_instance == null) { _instance = new NewsDatabase(databaseFactory); } } } return(_instance); }
private NewsUpdater() { this.newsDatabase = NewsDatabase.Instance; }
private NewsTweeter() { this.newsDatabase = NewsDatabase.Instance; this.random = new Random(); this.newsCrawler = new NewsCrawler(); }