public static Dict GetMatchingParams(StatementEqualsRef[] equalsRefs, Dict sourceParams) { Dict result = new Dict(); foreach (var keyValuePair in sourceParams) { StatementEqualsRef whereRef = Array.Find(equalsRefs, x => x.paramName == keyValuePair.Key); if (whereRef != null) { result[whereRef.fieldName] = keyValuePair.Value; } } return(result); }
public static Dict RemapStatementParamsToFieldValues(Dict statementParamsDict, StatementEqualsRef[] equalsRefs) { Dict result = new Dict(); foreach ((string statementParamName, object statementParamValue) in statementParamsDict) { StatementEqualsRef equalsRef = Array.Find(equalsRefs, x => x.paramName == statementParamName); if (equalsRef != null) { result[equalsRef.fieldName] = statementParamValue; } } return(result); }