Beispiel #1
0
        private static async void InitializeCommonSense(CloudTable table)
        {
            CommonSenseResult senseResult = new CommonSenseResult("JeepCompass");

            TableOperation tableOperation = TableOperation.Insert(senseResult);

            await table.ExecuteAsync(tableOperation);
        }
        public async Task <ActionResult <string> > Get()
        {
            CommonSenseResult currentResult = await new ValueTable(
                this.configuration["AppSettings:ConnectionStrings:StorageTableConnection"]
                , this.configuration["AppSettings:TableName"]
                ).InitializeIfNotExists()
                                              .Result.RetrieveValue("JeepCompass", "JeepCompass");

            return(currentResult.Sum.ToString());
        }
Beispiel #3
0
        private static async Task SumUp(int value)
        {
            var valueTable = new ValueTable(
                _configuration["AzureWebJobsStorage"]
                , _configuration["TableName"]);

            await valueTable.InitializeIfNotExists();

            CommonSenseResult commonSenseValue = await valueTable.RetrieveValue("JeepCompass", "JeepCompass");

            commonSenseValue.Update(value);

            valueTable.Update(commonSenseValue);
        }
Beispiel #4
0
        public async void Update(CommonSenseResult commonSenseValue)
        {
            TableOperation tableOperation = TableOperation.Replace(commonSenseValue);

            await this._table.ExecuteAsync(tableOperation);
        }