public void UpdateCache <TDbEntity>(List <TDbEntity> entities)
 {
     try
     {
         CacheEntity type        = CacheEntityMap.GetEntityTypeForDBEntity <TDbEntity>();
         CacheStatus cacheStatus = Uow.CacheStatusesRepository.GetCacheStatus(type);
         cacheStatus.Status      = CacheEntryStatus.UpdateInProgress;
         cacheStatus.LastUpdated = DateTime.UtcNow;
         // try to get DB lock;
         if (Uow.CacheStatusesRepository.TryUpdate(cacheStatus))
         {
             ICachedEntitiesRepository <TDbEntity> entityRepository = Uow.GetRepository <ICachedEntitiesRepository <TDbEntity> >();
             Task task = entityRepository.UpdateCacheAsync(entities);
             task.ContinueWith(task1 =>
             {
                 using (IOptionsPlayUow uow = ObjectFactory.GetInstance <IOptionsPlayUow>())
                 {
                     cacheStatus             = uow.CacheStatusesRepository.GetCacheStatus(type);
                     cacheStatus.Status      = CacheEntryStatus.Active;
                     cacheStatus.LastUpdated = DateTime.UtcNow;
                     uow.CacheStatusesRepository.Update(cacheStatus);
                     uow.Commit();
                 }
             });
         }
     }
     catch (Exception ex)
     {
         Logging.Logger.Debug("thread ID:" + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ", UpdateCache Exception is:" + ex.StackTrace.ToString() + ", class is DatabaseCacheService");
     }
 }
 public SuggestedStrategiesService(IOptionsPlayUow uow, IPredictionAndStdDevService predictionAndStdDevService, IMarketDataService marketDataService, IStrategyService strategyService)
     : base(uow)
 {
     _predictionAndStdDevService = predictionAndStdDevService;
     _marketDataService          = marketDataService;
     _strategyService            = strategyService;
 }
Example #3
0
 public MarketDataService(IMarketDataProviderQueryable marketDataProvider, IRiskFreeRateProvider riskFreeRateProvider, IMarketWorkTimeService marketWorkTimeService, IOptionsPlayUow uow)
 {
     _marketDataProvider    = marketDataProvider;
     _riskFreeRateProvider  = riskFreeRateProvider;
     _marketWorkTimeService = marketWorkTimeService;
     _uow = uow;
 }
        public AuthenticationService(IOptionsPlayUow uow, IAccountManager accountManager, IUserService userService)
            : base(uow)
        {
            //TODO: passing account manager could be a performance issue. Used only in Authenticate method. Need detailed investigation.
            _accountManager = accountManager;

            _userService = userService;
        }
 public DatabaseCacheService(IOptionsPlayUow uow) : base(uow)
 {
 }
 public SignalsService(IOptionsPlayUow uow)
     : base(uow)
 {
 }
 public SchedulerCoreService(IOptionsPlayUow uow)
     : base(uow)
 {
 }
Example #8
0
 public MemoryCacheService(IOptionsPlayUow uow)
     : base(uow)
 {
 }
Example #9
0
 public ConfigurationService(IOptionsPlayUow uow)
     : base(uow)
 {
 }
Example #10
0
 protected BaseService(IOptionsPlayUow uow)
 {
     Uow = uow;
 }
Example #11
0
 public MarketDataPopulatorService(IOptionsPlayUow uow)
 {
     _uow = uow;
 }
 public StrategyService(IOptionsPlayUow uow)
     : base(uow)
 {
 }
Example #13
0
 public TradeIdeaService(IOptionsPlayUow uow)
     : base(uow)
 {
     _uow = uow;
 }
Example #14
0
 public UserService(IOptionsPlayUow uow) : base(uow)
 {
 }