public async Task <IProjectResultData> GetAsync(string projectId, string participantId)
        {
            var partitionKey = ProjectResultEntity.GeneratePartitionKey(projectId);
            var rowKey       = ProjectResultEntity.GenerateRowKey(participantId);

            return(await _projectResultInfoTableStorage.GetDataAsync(partitionKey, rowKey));
        }
        public Task UpdateAsync(IProjectResultData resultData)
        {
            var partitionKey = ProjectResultEntity.GeneratePartitionKey(resultData.ProjectId);
            var rowKey       = ProjectResultEntity.GenerateRowKey(resultData.ParticipantId);

            return(_projectResultInfoTableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Update(resultData);
                return itm;
            }));
        }
Exemple #3
0
        public static ProjectResultEntity Create(IProjectResultData src)
        {
            var result = new ProjectResultEntity
            {
                PartitionKey        = GeneratePartitionKey(src.ProjectId),
                RowKey              = GenerateRowKey(src.ParticipantId),
                ProjectId           = src.ProjectId,
                ParticipantId       = src.ParticipantId,
                ParticipantFullName = src.ParticipantFullName,
                Link      = src.Link,
                Submitted = src.Submitted,
                Score     = src.Score
            };

            return(result);
        }
        public async Task <IEnumerable <IProjectResultData> > GetResultsAsync(string projectId)
        {
            var partitionKey = ProjectResultEntity.GeneratePartitionKey(projectId);

            return(await _projectResultInfoTableStorage.GetDataAsync(partitionKey));
        }
 public async Task SaveAsync(IProjectResultData resultData)
 {
     var newEntity = ProjectResultEntity.Create(resultData);
     await _projectResultInfoTableStorage.InsertAsync(newEntity);
 }