예제 #1
0
        public async Task <IProjectVoteData> GetAsync(string projectId, string user)
        {
            var partitionKey = ProjectVoteEntity.GeneratePartitionKey(projectId);
            var rowKey       = ProjectVoteEntity.GenerateRowKey(user);

            return(await _projectVoteTableStorage.GetDataAsync(partitionKey, rowKey));
        }
예제 #2
0
        public Task UpdateAsync(IProjectVoteData projectVoteData)
        {
            var partitionKey = ProjectVoteEntity.GeneratePartitionKey(projectVoteData.ProjectId);
            var rowKey       = ProjectVoteEntity.GenerateRowKey(projectVoteData.VoterUserId);

            return(_projectVoteTableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Update(projectVoteData);
                return itm;
            }));
        }
예제 #3
0
        public async Task <IEnumerable <IProjectVoteData> > GetProjectVotesAsync(string projectId)
        {
            var partitionKey = ProjectVoteEntity.GeneratePartitionKey(projectId);

            return(await _projectVoteTableStorage.GetDataAsync(partitionKey));
        }