public async Task StartContestAsync(Guid contestId) { var entity = await StorageAccessService.GetTableEntityAsync <JsonTableEntity <BeerContestModel> >(TableName, contestId.ToString(), contestId.ToString()); entity.Entity.State = BeerContestState.InProgress; var table = StorageAccessService.GetTableReference(TableName); TableOperation operation = TableOperation.Replace(entity); await table.ExecuteAsync(operation); }
public async Task <Guid> CreateContestAsync(BeerContestModel contest) { Guid contestId = Guid.NewGuid(); contest.Id = contestId; var entity = new JsonTableEntity <BeerContestModel>(contestId.ToString(), contestId.ToString(), contest); var table = StorageAccessService.GetTableReference(TableName); TableOperation operation = TableOperation.Insert(entity); await table.ExecuteAsync(operation); return(contestId); }
public async Task UpdateContestEntityAsync(JsonTableEntity <BeerContestModel> entity) { var table = StorageAccessService.GetTableReference(TableName); TableOperation operation = TableOperation.Replace(entity); await table.ExecuteAsync(operation); }