/// <summary> /// Disposes all external resources. /// </summary> /// <param name="disposing">The dispose indicator.</param> private void Dispose(bool disposing) { if (disposing) { if (_dbContext != null) { _dbContext.Dispose(); _dbContext = null; } } }
/// <summary> /// The main entry point for the application. /// </summary> //static void Main() //{ // ServiceBase[] ServicesToRun; // ServicesToRun = new ServiceBase[] // { // new MatchParserService() // }; // ServiceBase.Run(ServicesToRun); //} static void Main(string[] args) { Dota2DbContext dbContext = new Dota2DbContext(); IUnitOfWork unitOfWork = new UnitOfWork(dbContext); ITaskParserRepository taskRepository = new TaskParserRepository(dbContext); ISteamRepository onlineMatchRepository = new SteamRepository(); IMatchRepository matchRepository = new MatchRepository(dbContext); ITasksParser taskParser = new TasksParser(taskRepository, onlineMatchRepository, matchRepository, unitOfWork); #if DEBUG var service = new MatchParserService(taskParser); service.OnDebug(); Thread.Sleep(Timeout.Infinite); #else ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new MatchParserService(taskParser), }; ServiceBase.Run(ServicesToRun); #endif }
/// <summary> /// Initializes a new instance of the UnitOfWork class. /// </summary> /// <param name="context">The object context</param> public UnitOfWork(Dota2DbContext context) { _dbContext = context; }