コード例 #1
0
ファイル: UnitOfWork.cs プロジェクト: tautvisv/SD2WA
 /// <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;
         }
     }
 }
コード例 #2
0
ファイル: UnitOfWork.cs プロジェクト: tautvisv/SD2WA
 /// <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;
         }
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: tautvisv/SD2WA
        /// <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
        }
コード例 #4
0
ファイル: UnitOfWork.cs プロジェクト: tautvisv/SD2WA
        /// <summary>
        /// Initializes a new instance of the UnitOfWork class.
        /// </summary>
        /// <param name="context">The object context</param>
        public UnitOfWork(Dota2DbContext context)
        {

            _dbContext = context;
        }
コード例 #5
0
ファイル: UnitOfWork.cs プロジェクト: tautvisv/SD2WA
 /// <summary>
 /// Initializes a new instance of the UnitOfWork class.
 /// </summary>
 /// <param name="context">The object context</param>
 public UnitOfWork(Dota2DbContext context)
 {
     _dbContext = context;
 }