public Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
     SubscriptionTrackingElement configuration)
 {
     var path = configuration.GetString("path");
     var fsTrackingBaseDir = new DirectoryInfo(GetRootedPath(path));
     var fsTrackingService = new FilesystemSubscriptionTrackingService(fsTrackingBaseDir);
     fsTrackingService.Init();
     return Task.FromResult<ISubscriptionTrackingService>(fsTrackingService);
 }
Exemplo n.º 2
0
 public async Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
     SubscriptionTrackingElement configuration)
 {
     var path = configuration.GetString("path");
     var sqliteBaseDir = new DirectoryInfo(GetRootedPath(path));
     var sqliteSubscriptionTrackingService = new SQLiteSubscriptionTrackingService(sqliteBaseDir);
     await sqliteSubscriptionTrackingService.Init();
     return sqliteSubscriptionTrackingService;
 }
Exemplo n.º 3
0
        public async Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
            SubscriptionTrackingElement configuration)
        {
            var connectionName = configuration.GetString("connectionName");
            if (string.IsNullOrWhiteSpace(connectionName))
            {
                throw new ConfigurationErrorsException(
                    "Attribute 'connectionName' is required for SQL subscription tracking service");
            }

            var connectionStringSettings = ConfigurationManager.ConnectionStrings[connectionName];
            if (connectionStringSettings == null)
            {
                throw new ConfigurationErrorsException("Connection string settings \"" + connectionName + "\" not found");
            }
            var sqlSubscriptionTrackingService = new SQLSubscriptionTrackingService(connectionStringSettings);
            await sqlSubscriptionTrackingService.Init();
            return sqlSubscriptionTrackingService;
        }