I am working on a problem in c#. I have an array of objects and one key object. There are five properties of an object:
- Group
- country
- Service
- Industry
- Technology
I want to arrange objects such that most matching object with key object will be displayed first. I want to arrange that data in following order -
- It will get objects of same group as group of key object.
- If objects of same group are found then these will be ordered according to country. i.e. If same parameter value is found then order will be decided according to next parameter.
- Same process will be followed for objects with different groups also.
I have got one solution: I created 32 linq queries with each permutation and combination of 5 parameters, then I merged those 32 results one by one. This solution gives me desired results but this solution needs a lot of processing. Please provide any shorter solution.
Thanks in advance.