Ejemplo n.º 1
0
        public async Task DeleteAsync(string projectId, string participantId, string voterId)
        {
            var partitionKey = ProjectResultVoteEntity.GeneratePartitionKey(projectId);
            var rowKey       = ProjectResultVoteEntity.GenerateRowKey(participantId, voterId);

            await _projectResultVoteTableStorage.DeleteAsync(partitionKey, rowKey);
        }
Ejemplo n.º 2
0
        public async Task <IProjectResultVoteData> GetAsync(string projectId, string participantId, string voterId)
        {
            var partitionKey = ProjectResultVoteEntity.GeneratePartitionKey(projectId);
            var rowKey       = ProjectResultVoteEntity.GenerateRowKey(participantId, voterId);

            return(await _projectResultVoteTableStorage.GetDataAsync(partitionKey, rowKey));
        }
        public static ProjectResultVoteEntity Create(IProjectResultVoteData src)
        {
            var result = new ProjectResultVoteEntity
            {
                RowKey = GenerateRowKey(src.ParticipantId, src.VoterUserId),
                PartitionKey = GeneratePartitionKey(src.ProjectId),
                ParticipantId = src.ParticipantId
            };

            return result;
        }
Ejemplo n.º 4
0
        public static ProjectResultVoteEntity Create(IProjectResultVoteData src)
        {
            var result = new ProjectResultVoteEntity
            {
                RowKey        = GenerateRowKey(src.ParticipantId, src.VoterUserId),
                VoterUserId   = src.VoterUserId,
                PartitionKey  = GeneratePartitionKey(src.ProjectId),
                ParticipantId = src.ParticipantId,
                UserAgent     = src.UserAgent,
                Type          = src.Type
            };

            return(result);
        }
Ejemplo n.º 5
0
        public async Task <IEnumerable <IProjectResultVoteData> > GetProjectResultVotesAsync(string projectId)
        {
            var partitionKey = ProjectResultVoteEntity.GeneratePartitionKey(projectId);

            return(await _projectResultVoteTableStorage.GetDataAsync(partitionKey));
        }
Ejemplo n.º 6
0
 public async Task SaveAsync(IProjectResultVoteData projectResultVoteData)
 {
     var newEntity = ProjectResultVoteEntity.Create(projectResultVoteData);
     await _projectResultVoteTableStorage.InsertAsync(newEntity);
 }