public async Task DeleteAsync(string userId, string projectId) { var partitionKey = ProjectExpertEntity.GeneratePartitionKey(projectId); var rowKey = ProjectExpertEntity.GenerateRowKey(userId); await _projectExpertsTableStorage.DeleteIfExistAsync(partitionKey, rowKey); }
public async Task <IProjectExpertData> GetAsync(string projectId, string participantId) { var partitionKey = ProjectExpertEntity.GeneratePartitionKey(projectId); var rowKey = ProjectExpertEntity.GenerateRowKey(participantId); return(await _projectExpertsTableStorage.GetDataAsync(partitionKey, rowKey)); }
public Task UpdateAsync(IProjectExpertData projectExpertData) { var partitionKey = ProjectExpertEntity.GeneratePartitionKey(projectExpertData.ProjectId); var rowKey = ProjectExpertEntity.GenerateRowKey(projectExpertData.UserId); return(_projectExpertsTableStorage.ReplaceAsync(partitionKey, rowKey, itm => { itm.Update(projectExpertData); return itm; })); }
public static ProjectExpertEntity Create(IProjectExpertData src) { var result = new ProjectExpertEntity { PartitionKey = GeneratePartitionKey(src.ProjectId), RowKey = GenerateRowKey(src.UserId), ProjectId = src.ProjectId, UserId = src.UserId, UserIdentifier = src.UserIdentifier, StreamsId = src.StreamsId, FullName = src.FullName, Description = src.Description, Priority = src.Priority }; return(result); }
public async Task SaveAsync(IProjectExpertData projectExpertData) { var newEntity = ProjectExpertEntity.Create(projectExpertData); await _projectExpertsTableStorage.InsertAsync(newEntity); }
public async Task <IEnumerable <IProjectExpertData> > GetProjectExpertsAsync(string projectId) { var partitionKey = ProjectExpertEntity.GeneratePartitionKey(projectId); return(await _projectExpertsTableStorage.GetDataAsync(partitionKey)); }