Пример #1
0
        public static async Task SetupRecords(ITableStore <TestTableEntity> tableStorage)
        {
            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("John", "Smith")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Jane", "Smith")
                {
                    Age = 28, Email = "*****@*****.**"
                }
            };

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Jones")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            entityList.Combine(anotherEntityList);

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);
        }
Пример #2
0
        public void Initialize()
        {
            string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"];
            string userTableName    = ConfigurationManager.AppSettings["UserTableName"];

            this.store = new TableStore(connectionString, userTableName);
        }
Пример #3
0
        public LuisRootDialog(UserState userState, ITableStore tableStore, IBotServices botServices)
            : base(nameof(LuisRootDialog))
        {
            _luisRootDialogStateAccessor = userState.CreateProperty <LuisRootDialogState>(nameof(LuisRootDialogState));
            _tableStore = tableStore;

            // Add child dialogs
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                GetLuisResultAsync,
                GetEntitiesAsync,
                EstablishMandatoryCategoriesAsync,
                PromptCpuCategoryAsync,
                HandleCpuCategoryAsync,
                PromptColourCategoryAsync,
                HandleColourCategoryAsync,
                PromptConnectivityCategoryAsync,
                HandleConnectivityCategoryAsync,
                PromptMemoryCategoryAsync,
                HandleMemoryCategoryAsync,
                PromptProductCategoryAsync,
                HandleProductCategoryAsync,
                PromptProductFamilyCategoryAsync,
                HandleProductFamilyCategoryAsync,
                PromptStorageCategoryAsync,
                HandleStorageCategoryAsync,
                ShowLinkAsync,
                FinalStepAsync,
            }));
            AddDialog(new TextPrompt(nameof(TextPrompt)));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
            AddDialog(new ShowLinkDialog(nameof(ShowLinkDialog), botServices));
        }
Пример #4
0
 public ItemStore(IStorageLocator storageLocator)
 {
     _table = storageLocator.GetTable(TABLE_NAME);
     _rawBlob = storageLocator.GetBlob(RAW_BLOB_NAME);
     _finishedBlob = storageLocator.GetBlob(FINISHED_BLOB_NAME);
     _queue = storageLocator.GetQueue(QUEUE_NAME);
 }
Пример #5
0
        public RecommendationFacetStorageWorker(ITableStoreFactory tableStoreFactory, IXdbContext xdbContext, IReadOnlyDictionary <string, string> options)
        {
            _tableName = options[OptionTableName];
            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);
            _xdbContext = xdbContext;
        }
Пример #6
0
        public static void SetupRowKeyRecords(ITableStore <TestTableEntity> tableStorage)
        {
            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("John", "Smith")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Jane", "Smith")
                {
                    Age = 28, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Smith")
                {
                    Age = 38, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(entityList).Wait();

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Jones")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(anotherEntityList).Wait();

            var moreEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Bill", "King")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(moreEntityList).Wait();

            var evenMoreEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Bloggs")
                {
                    Age = 32, Email = "*****@*****.**"
                }
            };

            tableStorage.InsertAsync(evenMoreEntityList).Wait();
        }
Пример #7
0
        public ProductRecommendationWorker(ITableStoreFactory tableStoreFactory, ILogger logger, IReadOnlyDictionary <string, string> options)
        {
            _sourceTableName = options[OptionSourceTableName];
            _targetTableName = options[OptionTargetTableName];
            _limit           = int.Parse(options[OptionLimit]);

            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);

            _logger = logger;
        }
Пример #8
0
        public MovieRecommendationWorker(ITableStoreFactory tableStoreFactory, IMovieRecommendationsProvider movieRecommendationsProvider, IReadOnlyDictionary <string, string> options)
        {
            _sourceTableName = options[OptionSourceTableName];
            _targetTableName = options[OptionTargetTableName];
            _limit           = int.Parse(options[OptionLimit]);

            _movieRecommendationsProvider = movieRecommendationsProvider;

            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);
        }
Пример #9
0
 public static void SetupLotsOfRecords(int count, ITableStore <TestTableEntity> tableStorage)
 {
     tableStorage.CreateTable();
     for (var i = 0; i < count; i++)
     {
         var entry = new TestTableEntity($"name{i}", $"surname{count}")
         {
             Age = 32, Email = $"surname{count}@somewhere.com"
         };
         tableStorage.Insert(entry);
     }
 }
Пример #10
0
 public RfmTrainingWorker(
     ITableStoreFactory tableStoreFactory,
     IServiceProvider provider,
     ILogger <RfmTrainingWorker> logger,
     AllowedModelsDictionary modelsDictionary,
     RfmTrainingWorkerOptionsDictionary options,
     IServiceProvider serviceProvider)
 {
     _tableStore      = tableStoreFactory.Create(options.SchemaName);
     _options         = options;
     _logger          = logger;
     _model           = modelsDictionary.CreateModel <Interaction>(provider, options.ModelType, options.ModelOptions);
     _serviceProvider = serviceProvider;
 }
        public AzureTableStorageConfigurationProvider(ITableStore <ConfigurationEntry> configurationEntityStore, string tableName, string partitionKey, CancellationToken cancellationToken)
        {
            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new ArgumentException($"{nameof(tableName)} cannot be null or white space.", nameof(tableName));
            }

            if (string.IsNullOrWhiteSpace(partitionKey))
            {
                throw new ArgumentException($"{nameof(partitionKey)} cannot be null or white space.", nameof(partitionKey));
            }

            _configurationEntityStore = configurationEntityStore ?? throw new ArgumentNullException(nameof(configurationEntityStore));
            _tableName         = tableName;
            _partitionKey      = partitionKey;
            _cancellationToken = cancellationToken;
        }
Пример #12
0
        public RootDialog(UserState userState, IBotServices botServices, ITableStore tableStore, IConfiguration configuration)
            : base(nameof(LuisRootDialog))
        {
            InitialDialogId = nameof(RootDialog);
            _botServices    = botServices;
            _tableStore     = tableStore;

            // Define the steps of the waterfall dialog and add it to the set.
            var waterfallSteps = new WaterfallStep[]
            {
                HandleUtteranceAsync,
                PromptForNextQuestionAsync,
                HandleWhatNextAsync,
            };

            AddDialog(new WaterfallDialog(InitialDialogId, waterfallSteps));
            AddDialog(new TextPrompt(TextPromptName));

            // Child dialogs
            AddDialog(new LuisRootDialog(userState, _tableStore, botServices));
        }
Пример #13
0
        public static async Task SetupRecordsAgo(ITableStore <TestTableEntity> tableStorage, string ago)
        {
            await tableStorage.DeleteAllAsync();

            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("Kevin", "Bacon")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Steven", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                }
            };

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);

            await Task.Delay(TimeStringParser.GetTimeAgoTimeSpan(ago));

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Liam", "Matthews")
                {
                    Age = 28, Email = "*****@*****.**"
                },
                new TestTableEntity("Mary", "Gates")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            await tableStorage.InsertAsync(anotherEntityList).ConfigureAwait(false);
        }
 public Functions(ITableStoreFactory tableFactory, IConfiguration config)
 {
     _table = tableFactory.CreateTableStore <LogEntity>("ExampleLogs", config["AzureWebJobsStorage"]);
     _table.CreateTable();
 }
Пример #15
0
 public TableStoreAsyncTests()
 {
     _tableStorage        = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions);
     _tableStorageDynamic = new TableStoreDynamic(TableName, ConnectionString);
 }
Пример #16
0
        public TableExceptionStore(ITableStore store)
        {
            EnsureArg.IsNotNull(store);

            _store = store;
        }
Пример #17
0
 public CertificateStore(ITableStore tableStore, IConfiguration config, ILogger <CertificateStore> logger)
 {
     this.tableStore = tableStore;
     this.logger     = logger;
     this.url        = config["siteRoot"] ?? "https://exams.kcsara.org";
 }
Пример #18
0
 public TableStoreTests(ITestOutputHelper testOutputHelper)
 {
     _testOutputHelper = testOutputHelper;
     _tableStorage     = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions);
     SystemTime.UtcNow = () => DateTime.UtcNow;
 }
Пример #19
0
 public UserRepository(ITableStore tableTableStore)
 {
     this.tableTableStore = tableTableStore;
 }
Пример #20
0
 public VoteRepository(ITableStore tableTableStore)
 {
     this.tableTableStore = tableTableStore;
 }
Пример #21
0
 public NewsTableRepository(ITableStore tableStore)
 {
     this.tableStore = tableStore;
 }
 public TableStoreTests()
 {
     _tableStorage = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions);
 }