I am a bit stuck here. I have a complicated API that was designed by a third party to retrieve User and Business data with custom search criteria. The search criteria syntax and format is not relevant but I am having to pass multiple keys and corresponding values. I need help creating the function.
Currently I have this function in my interface:
Response GetUser(
List<string> keys,
List<string> values,
List<string> fieldsToReturn= null
);
What's the best way to pass multiple keys and values where they can be tied/mapped together? And as one parameter? Key and value must match in count 1:1. Value is a search value that is tied to its corresponding key.
I already have pretty good validation with the current setup that it works okay, but I'm reconsidering and wanting to make key and value passed together to avoid too many unforseen input validation issues.
question from:
https://stackoverflow.com/questions/65914728/best-way-to-pass-multiple-keys-and-values-together-in-a-function 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…