public ShoppingCartTableEntity Get(string rowKey)
        {
            var            table             = this.tableClient.GetTableReference(TableName);
            var            partitionKey      = ShoppingCartTableEntity.CalculatePartitionKey(rowKey);
            TableOperation retrieveOperation = TableOperation.Retrieve <ShoppingCartTableEntity>(partitionKey, rowKey);

            try
            {
                TableResult retrievedResult = table.Execute(retrieveOperation);
                return((ShoppingCartTableEntity)retrievedResult.Result);
            }
            catch (System.Exception)
            {
                return(null);
            }
        }
Example #2
0
 public ShoppingCartTableEntity(string userId)
 {
     this.RowKey       = userId;
     this.PartitionKey = ShoppingCartTableEntity.CalculatePartitionKey(userId);
 }