0

I am using Dapper Extension method GetByPredicate and passing the predicate value with Like operator.

Predicates.Field<Entity>(row => row, Operator.Like, $"%{string}%")

But while matching the string pattern it is returning results in reverse order, eg: if the sql table contains rows having 'test1' and 'test2' string then for a given string 'test', it is returning results as test2 and test1.

Wondering why it is returning in reversed order.

dev31
  • 11
  • 3

1 Answers1

1

Relational databases usually do not guarantee order in which rows are returned. If you want you rows returned in specific order use order by clause for this purpose.

Alexander
  • 9,104
  • 1
  • 17
  • 41