public async Task <PatientItem> CreateAPatientInformation(CloudTable table, String invocationName, Patient patient) { var patientInformation = new Patient(patient); var query = new PatientItem(patient); var operation = TableOperation.InsertOrMerge(query); var tableResult = await table.ExecuteAsync(operation); return((PatientItem)tableResult.Result); }
public async Task <PatientItem> DeleteAPatientInformation(CloudTable table, String invocationName, Patient patient) { var patientInformation = new Patient(patient); var query = new PatientItem(patient); var operation = TableOperation.Retrieve <PatientItem>(query.PartitionKey, query.RowKey); var readResult = table.ExecuteAsync(operation).GetAwaiter().GetResult().Result as PatientItem; operation = TableOperation.Delete(readResult); var deleteResult = await table.ExecuteAsync(operation); return((PatientItem)deleteResult.Result); }