internal static DatabaseTableListResult DeserializeDatabaseTableListResult(JsonElement element) { Optional <IReadOnlyList <DatabaseTableData> > value = default; Optional <string> nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <DatabaseTableData> array = new List <DatabaseTableData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(DatabaseTableData.DeserializeDatabaseTableData(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new DatabaseTableListResult(Optional.ToList(value), nextLink.Value)); }
private void LoadAndCreateCommands(DatabaseTableData data) { if (data.TableDefinition.Commands == null) { return; } foreach (var command in data.TableDefinition.Commands) { var cmd = commandService.FindCommand(command.CommandId); if (cmd != null) { Commands.Add(new TableCommandViewModel(cmd, new AsyncAutoCommand(() => { return(messageBoxService.WrapError(() => WrapBulkEdit( () => WrapBlockingTask( () => cmd.Process(command, new DatabaseTableData(data.TableDefinition, Entities)) ), cmd.Name))); }))); } else { var cmdPerKey = commandService.FindPerKeyCommand(command.CommandId); if (cmdPerKey == null) { throw new Exception("Command " + command.CommandId + " not found!"); } Commands.Add(new TableCommandViewModel(cmdPerKey, new AsyncAutoCommand(() => { return(messageBoxService.WrapError(() => WrapBulkEdit( () => WrapBlockingTask(() => cmdPerKey.Process(command, new DatabaseTableData(data.TableDefinition, Entities), GenerateKeys(), this)) , cmdPerKey.Name))); }))); } } }
protected abstract Task InternalLoadData(DatabaseTableData data);