Let's say I have 3 client names:
Microsoft Another customer also called Microsoft A third customer called Microsoft
Now, if I request clients like this ...
var q = (from cust in db.Cust where cust.Name.Contains("Microsoft") orderby cust.Name ascending select cust)
... I get this order:
A third customer called Microsoft Another customer also called Microsoft Microsoft
What I want is to get Microsoft first, based on the fact that it starts with Microsoft.
Changing Contains to StartsWith, of course, leaves me with 1 result instead of 3.
Could this be done in a single request?
source share