How to make NameValueCollection
accessible to LINQ query operator such as where, join, groupby?
I tried the below:
private NameValueCollection RequestFields()
{
NameValueCollection nvc = new NameValueCollection()
{
{"emailOption: blah Blah", "true"},
{"emailOption: blah Blah2", "false"},
{"nothing", "false"},
{"nothinger", "true"}
};
return nvc;
}
public void GetSelectedEmail()
{
NameValueCollection nvc = RequestFields();
IQueryable queryable = nvc.AsQueryable();
}
But I got an ArgumentException telling me that the source is not IEnumerable<>.
See Question&Answers more detail:os