Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created January 25, 2021 20:38
Show Gist options
  • Save rdelrosario/8d01ba2fe6dccf0255d2f079a04ecd55 to your computer and use it in GitHub Desktop.
Save rdelrosario/8d01ba2fe6dccf0255d2f079a04ecd55 to your computer and use it in GitHub Desktop.
var sortPredicate = this.WhenAnyValue(x => x.SortBy)
.Select(x => x == "Type" ? SortExpressionComparer<Restaurant>.Ascending(a => a.Type) : SortExpressionComparer<Restaurant>.Ascending(a => a.Name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment