Here is my dataset:
1 David
2 David
3 Marc
4 Marc
5 Marc
6 Marc
7 Marc
8 Marc
9 Marc
10 Marc
11 Marc
12 Marc
13 Marc
14 Marc
15 Marc
This query returns 2 records (correct):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>David</value>%"));
This query returns 2 records (correct):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>%David%</value>%"));
This query returns 0 records (correct):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>av</value>%"));
This query returns 2 records (correct):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>%av%</value>%"));
This query returns 0 records (correct):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>v</value>%"));
This query returns 15 records (incorrect, should return 2):
query = query.Where(Log => SqlMethods.Like
(Log.FormattedMessage, "%<key>Name</key><value>%v%</value>%"));
What is wrong with the last query? Is it a bug or am I missing something?