what the fuck?

This commit is contained in:
j4ck 2022-06-05 00:01:35 +03:00
parent 278041d688
commit 624f96e104
2 changed files with 4 additions and 2 deletions

View File

@ -83,13 +83,14 @@ public class Database
var table = query?.TableName;
var key = query?.Key;
var value = query?.Value;
var newValue = query?.NewValue;
var tableToReturn = _tables.Find(x => x.Name == table);
var row = tableToReturn?.Rows?.FirstOrDefault(x => x.Columns?.FirstOrDefault(y => y.Name == key)?.Name == key);
var row = tableToReturn?.Rows?.FirstOrDefault(x => x.Columns?.FirstOrDefault(y => y.Name == key)?.Value == value);
var column = row?.Columns?.FirstOrDefault(x => x.Name == key);
if (column != null)
column.Value = value;
column.Value = newValue;
Save();
}

View File

@ -5,4 +5,5 @@ public class SetQuery : Query
public string TableName { get; set; }
public string Key { get; set; }
public string Value { get; set; }
public string NewValue { get; set; }
}