linq - IQueriable() to ListAsync() conversion issue due to filter on list inside a list -
i have issue filtering list inside list on async method.
private async task<list<userlist>> getasynclist(string query) { var result = getuserlist.where(x => x.firstname.toupper().contains(query.toupper()) || x.lastname.toupper().contains(query.toupper()) || x.emailid.toupper().contains(query.toupper()) **|| x.userrole.any(a => a.toupper().contains(query.toupper()))**); return await result.tolistasync(); }
getting below exception
expression of type 'system.collections.generic.iasyncenumerable
1[system.string]' cannot used parameter of type 'system.collections.generic.ienumerable
1[system.string]' of method 'system.collections.generic.list1[system.string] tolist[string](system.collections.generic.ienumerable
1[system.string])' parameter name: arg0
kindly on this!
Comments
Post a Comment