private WorkspaceEntity toEntity(WorkspaceTableEntity tableEntity) { WorkspaceEntity entity = new WorkspaceEntity(); entity.Workspace_ID = tableEntity.PartitionKey; entity.Epoch = tableEntity.RowKey; if (!string.IsNullOrWhiteSpace(tableEntity.Name)) { entity.Name = tableEntity.Name; } if (!string.IsNullOrWhiteSpace(tableEntity.Owner)) { entity.Owner = tableEntity.Owner; } if (!string.IsNullOrWhiteSpace(tableEntity.Users)) { entity.Users = tableEntity.Users; } if (!string.IsNullOrWhiteSpace(tableEntity.PictureLocation)) { entity.PictureLocation = tableEntity.PictureLocation; } return(entity); }
private WorkspaceTableEntity toTableEntity(WorkspaceEntity entity) { WorkspaceTableEntity tableEntity = new WorkspaceTableEntity(entity.Workspace_ID, entity.Epoch); if (!string.IsNullOrWhiteSpace(entity.Name)) { tableEntity.Name = entity.Name; } if (!string.IsNullOrWhiteSpace(entity.Owner)) { tableEntity.Owner = entity.Owner; } if (!string.IsNullOrWhiteSpace(entity.Users)) { tableEntity.Users = entity.Users; } if (!string.IsNullOrWhiteSpace(entity.PictureLocation)) { tableEntity.PictureLocation = entity.PictureLocation; } return(tableEntity); }
public async Task <WorkspaceEntity> Get(string[] key, string[] value) { return(await Task <WorkspaceEntity> .Run(() => { WorkspaceTableEntity workspaceTableEntity = this.cloudTable.Get(key, value).Result; return this.toEntity(workspaceTableEntity); })); }
public async Task <bool> Delete(WorkspaceEntity entity) { WorkspaceTableEntity workspaceTableEntity = this.toTableEntity(entity); return(await this.cloudTable.Delete(workspaceTableEntity)); }