Try our conversational search powered by Generative AI!

Custom calculated sorting


Hi, is there any way to these kind of things:

var result = this.findClient
	.OrderBy(content => content.SortTimeTicks - DateTime.UtcNow.Ticks < 0 
		? (content.SortTimeTicks - DateTime.UtcNow.Ticks) * -1 
		: content.SortTimeTicks - DateTime.UtcNow.Ticks)

i.e. on the fly calculations manipulating the sort order.

/Regard Niklas

Mar 14, 2017 10:12

Hi Niklas I assume you're trying to get a random order to the search results?

There is a NuGet package that does this -

Mar 24, 2017 10:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.