/// <summary> /// Method to Create Entity /// </summary> /// <param name="entity"></param> public void CreateEntity(ImageEntity entity) { CloudTable table = tableClient.GetTableReference("ImageEntityTable1"); //Create a TableOperation object used to insert Entity into Table TableOperation insertOperation = TableOperation.Insert(entity); //Execute an Insert Operation table.ExecuteAsync(insertOperation); }
/// <summary> /// Method to get specific entity based on the Row Key and the Partition key /// </summary> /// <param name="partitionKey"></param> /// <param name="rowKey"></param> /// <returns></returns> public async Task <ImageEntity> GetEntity(string partitionKey, string rowKey) { ImageEntity entity = null; CloudTable table = tableClient.GetTableReference("ImageEntityTable1"); TableOperation tableOperation = TableOperation.Retrieve <ImageEntity>(partitionKey, rowKey); //entity = await (table.ExecuteAsync(tableOperation).Result as ImageEntity); return(entity); }