I'veI have to perform on some collection and return ranking based on some logic I wish to optimize this working code since I think it can be bettered (maybe using Taskstasks?).
Here's my codeI need to search on Counterparts item. I load this data from DB and extension method that performsI've got more aliases per counterpart.
I need to return the searchresult based on those criteria:
CounterpartCodeis equal to search stringCounterpartCodestarts with search stringCounterpartCodecontains search stringCounterpartDescriptioncontains search stringCounterpartAliasis equal to search stringCounterpartAliasstarts with search stringCounterpartAliascontains search string
Each of those rules starts from Ranking 1 to 7 and I have to sort ok that ranking ascending.
Any suggestions? Thanks
#UPDATE #1
Here's a little bit of story about my problem.. I need to search on Counterparts item . I load those data from DB and I've got more aliases per counterpart.
I need to return the result based on those criteria :
- Counterpart Code is equal to search string
- Counterpart Code starts with search string
- Counterpart Code cointains search string
- Counterpart Description contains search string
- Counterpart Alias is equal to search string
- Counterpart Alias starts with search string
- Counterpart Alias contains search string
Each of those rules starts from Ranking 1 to 7 and I have to sort ok that ranking ascending