I need to move the Status == 'Processing' to the first row at here. I tried used OrderBy but return SqlExpression error as there is OrderByFields before it. Can anyone help?
var inputQuery = db.From<WO>()
.Where<WO>(x => x.ProcessDateTime.Substring(5, 2) == "06")
.OrderByFields("PRDLine", "-ProcessDateTime");
You must pass
SqlExpressiontoSinglemethod.If you only want first row, add
.Take(1)afterOrderByFieldsso you forceSELECT TOP 1on SQL query generation.