Example #1
0
        public async Task <bool> Add(EmployeeSessionEntity entity,
                                     CancellationToken cancellationToken = default)
        {
            TableOperation insertOp = TableOperation.Insert(entity);

            var tableResult = await _table.ExecuteAsync(insertOp);

            return((int)HttpStatusCode.NoContent == tableResult.HttpStatusCode);
        }
        public void OnGet()
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse("<ENTER CONNECTION STRING>");

            CloudTableClient client = storageAccount.CreateCloudTableClient();

            CloudTable table = client.GetTableReference("employee");

            table.CreateIfNotExistsAsync();

            var emp = new EmployeeSessionEntity(1, "BillG", 123456.33);

            TableOperation insertOp = TableOperation.Insert(emp);

            table.ExecuteAsync(insertOp);
        }