diff --git a/GangsImpl/SQL/SQLInstanceManager.cs b/GangsImpl/SQL/SQLInstanceManager.cs index 776f659..57f6442 100644 --- a/GangsImpl/SQL/SQLInstanceManager.cs +++ b/GangsImpl/SQL/SQLInstanceManager.cs @@ -24,25 +24,17 @@ public void ClearCache() { } $"SELECT {(typeof(TV).IsPrimitive ? statId : getFieldNames())} FROM {table_prefix}_{statId} WHERE GangId = @GangId", new { GangId = key }); return (true, result); - } catch (InvalidOperationException e) { - Console.WriteLine(e); - return (false, default); - } + } catch (InvalidOperationException) { return (false, default); } } public async Task SetForGang(int gangId, string statId, TV value) { await createTable(statId); - // var fields = typeof(TV).GetRuntimeFields().ToList(); var fields = typeof(TV) .GetProperties(BindingFlags.Public | BindingFlags.Instance) .ToList(); - // var fieldNames = fields.Select(f => f.Name).ToList(); - - // var columns = string.Join(", ", fieldNames); var columns = getFieldNames(); - // var values = string.Join(", ", fieldNames.Select(f => $"@{f}")); - var values = getFieldNames("@"); + var values = getFieldNames("@"); if (typeof(TV).IsPrimitive) { columns = statId; @@ -111,7 +103,6 @@ virtual protected string GetDBType(Type type) { } private async Task createTable(string id) { - // Get public fields of TV var fields = typeof(TV) .GetProperties(BindingFlags.Public | BindingFlags.Instance) .ToList();