我有这个返回单个用户的代码:
return RetryWithExpression<User, User>(u => u.FirstOrDefault(x => x.UserEmail == userEmail));
我正在尝试对其进行转换,以便它返回许多这样的用户:
return RetryWithExpression<User, List<User>>(u => u.Select(x => x.sUserCity == cityId));
这不编译,我得到一个错误:
Cannot implicitly convert type 'System.Linq.IQueryable<bool>' to 'System.Collections.Generic.List<User>'. An explicit conversion exists (are you missing a cast?)
如何从此方法返回列表?