I have a code snippet like this:
IReadOnlyList<ResultDTO> res = Repository.GetAll()
.Skip(input.SkipCount)
.Join(UserManager.Users, d=>d.CreatorUserId, c=> c.Id,
(d, c)=>d.MapToDto(c.UserName)
)
.OrderBy(x=>x.VerifiedByAdmin)
.ThenByDescending(x=>x.CreationTime)
.Take(input.MaxResultCount)
.ToList();
My expected result is all records that are not verified first and then verified records.
this code works properly when I remove the .Take(input.MaxResultCount) line but when this line is uncommented the result is not ordered according to my expectation.
I have changed the order of my code but re result was the same.
this code is written by Aspnet boilerplate.
My code does not throw any exception also my return the result into an IReadOnlyList and not a var variable.
Maybe this can be helpful if I say my database is SQLite.