Exemple #1
0
        private async Task <CloudTable> GetTableReferenceAsync()
        {
            var client = _cloudStorageClientFactory.CreateTableClient();

            var table = client.GetTableReference("signings");
            await table.CreateIfNotExistsAsync();

            return(table);
        }
Exemple #2
0
        public async Task RunAsync(ILogger logger)
        {
            var tableClient    = _cloudStorageClientFactory.CreateTableClient();
            var templatesTable = tableClient.GetTableReference("templates");
            await templatesTable.DeleteIfExistsAsync();

            foreach (var directory in Directory.EnumerateDirectories(Path.Combine(Directory.GetCurrentDirectory(), "Data", "Templates")))
            {
                var template       = JsonConvert.DeserializeObject <TemplateCreate>(File.ReadAllText(Path.Combine(directory, "metadata.json")));
                var templateMarkup = File.ReadAllText(Path.Combine(directory, "markup.xml"));

                template.Markup = templateMarkup;

                await _templateService.CreateTemplateAsync(template);
            }
        }