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); }
public void Initialize() { string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"]; string userTableName = ConfigurationManager.AppSettings["UserTableName"]; this.store = new TableStore(connectionString, userTableName); }
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)); }
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); }
public RecommendationFacetStorageWorker(ITableStoreFactory tableStoreFactory, IXdbContext xdbContext, IReadOnlyDictionary <string, string> options) { _tableName = options[OptionTableName]; var schemaName = options[OptionSchemaName]; _tableStore = tableStoreFactory.Create(schemaName); _xdbContext = xdbContext; }
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(); }
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; }
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); }
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); } }
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; }
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)); }
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(); }
public TableStoreAsyncTests() { _tableStorage = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions); _tableStorageDynamic = new TableStoreDynamic(TableName, ConnectionString); }
public TableExceptionStore(ITableStore store) { EnsureArg.IsNotNull(store); _store = store; }
public CertificateStore(ITableStore tableStore, IConfiguration config, ILogger <CertificateStore> logger) { this.tableStore = tableStore; this.logger = logger; this.url = config["siteRoot"] ?? "https://exams.kcsara.org"; }
public TableStoreTests(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; _tableStorage = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions); SystemTime.UtcNow = () => DateTime.UtcNow; }
public UserRepository(ITableStore tableTableStore) { this.tableTableStore = tableTableStore; }
public VoteRepository(ITableStore tableTableStore) { this.tableTableStore = tableTableStore; }
public NewsTableRepository(ITableStore tableStore) { this.tableStore = tableStore; }
public TableStoreTests() { _tableStorage = new TableStore <TestTableEntity>(TableName, ConnectionString, _tableStorageOptions); }