Ejemplo n.º 1
0
 /// <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;
         }
     }
 }
Ejemplo n.º 2
0
 /// <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;
         }
     }
 }
Ejemplo n.º 3
0
        /// <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
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the UnitOfWork class.
        /// </summary>
        /// <param name="context">The object context</param>
        public UnitOfWork(Dota2DbContext context)
        {

            _dbContext = context;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the UnitOfWork class.
 /// </summary>
 /// <param name="context">The object context</param>
 public UnitOfWork(Dota2DbContext context)
 {
     _dbContext = context;
 }