Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public async Task UpdateContestEntityAsync(JsonTableEntity <BeerContestModel> entity)
 {
     var            table     = StorageAccessService.GetTableReference(TableName);
     TableOperation operation = TableOperation.Replace(entity);
     await table.ExecuteAsync(operation);
 }