Say I have a collection which has 5 properties.
My Input: A=1;B=2;c=3;d=4;
Using this input i have to get the Property E ( which is exactly close to my input or nearly close to my input)
In this case my expected result is
Result A and Result C.
So should check the below combinations in code
if(A and B and C and D) all matches collection
take that;
break;
else if(A and B and C) matches the collection
take that;
break;
else if (A and B and D) matches the collection
take that;
break;
else if (A and B and D) matches the collection
take that;
else if (A and B) matches the collection
take that;
break;
else if(A and C) matches the collection
take that;
break;
else if(A and D) matches the collection
take that;
break;
else if A matches the collection
takethat;
break;
else if B matches the collection
take that;
break;
else if c matches the collection
take that;
break;
else if D matches the collection
take that;
break;
else
"No Match Found"
So when the number of properties to check is more , the more combinations we need to build . So i need to create a utility which build the combinations dynamically and check the comparison of objects. I can pass the properties as string array and can make the required combinations, but i have no clue how to access the object properties.
How to handle this situation ?