0

I'm attempting to order some data using a certain pattern and need some help figuring out how to do so. I haven't seen any examples of using linq queries within an orderby clause and am not exactly sure how to order the data in this scenario:

public IList<UserEventModel> GetListData(IDictionary<string, IList<string>> criteria, IEnumerable<UserEventModel> subscriptions) { subscriptions = subscriptions.OrderBy(x => x.EntityType); } 

Looking for an extension to append to EntityType to compare against the contents of 'criteria' value pair here at key[2], e.g. x => x.EntityType.? (specified collection of values)

1

1 Answer 1

1

your are almost right. Append tolist and try

 subscriptions = subscriptions .OrderBy(x => x.EntityType).ToList(); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.