Fixed ResolveByPrimaryKey not having runDataLossChecks implemented

master v1.2
Railz 6 years ago
parent e8e1fb993d
commit fb6cf14402

@ -85,12 +85,12 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <param name="classObject">Given object (marked with Db-attributes)</param> /// <param name="classObject">Given object (marked with Db-attributes)</param>
/// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param> /// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param>
/// <param name="ignoreDataAttributeNotInClass">This disables errors when class-field has no data-attribute</param> /// <param name="runDataLossChecks">This checks if any class-field and data-attribute does not exists in either (Slower)</param>
public static void ResolveByPrimaryKey<T>(T classObject, Func<string, Dictionary<string, object>> queryExecutor, bool ignoreDataAttributeNotInClass = false) public static void ResolveByPrimaryKey<T>(T classObject, Func<string, Dictionary<string, object>> queryExecutor, bool runDataLossChecks = true)
{ {
string query = QueryBuilder.SelectByPrimaryKey(classObject); string query = QueryBuilder.SelectByPrimaryKey(classObject);
Dictionary<string, object> data = queryExecutor(query); Dictionary<string, object> data = queryExecutor(query);
FillObject(classObject, data, ignoreDataAttributeNotInClass); FillObject(classObject, data, runDataLossChecks);
} }
} }
} }

Loading…
Cancel
Save