Was this helpful?
Our application has a search screen in which users search a very large database with doctor and nurse records. They can specify:
Any combination is possible: sometimes only a search string is given and in other cases a search string, filters, and multiple sort orders are given.
The query is created in LINQ. Everything is fine, but translating the Sort Orders into LINQ are causing us a huge headache. For example, one user may need to sort by FirstName ASC, LastName ASC, and City ASC, whereas another may need State DESC, Gender ASC, Category ASC. etc.etc.
To build an if statement with all possible combinations is a nightmare (read almost impossible) as it creates an explosion of possible
How is this handled in LINQ? There does not seem to be an obvious solution.
|asked||Apr 03, 2016|
|active||Apr 04, 2016|
|•||Going forward: Should I rewrite my HtmlHelpers into TagHelpers?|
|•||Creating nested TagHelpers in ASP.NET Core|
|•||C#: best practice of when to use a var vs the actual type?|
|•||Is there a difference between String and string in C#?|
|•||How to Encrypt and Decrypt a string in C#|
|•||How can I prevent SQL-injection in ADO.NET?|
|•||When to use 'ref' and 'out' keywords - specifically with strings?|
|•||How to return multiple values from a function in ES6|
|•||Why does the C# Random number generator just create a single number?|
|•||C# Singleton design pattern example|