I'm having troubles with this ternary line:
var userFromContext = IsOwner ? db.Owners.Where(o => o.UserName == username)
: db.Users.Where(u => u.UserName == username);
It's giving me this error message:
Type of conditional expression cannot be determined because there is no implicit conversion between System.LINQ.IQueryable<Owners>
and System.LINQ.IQueryable<Users>
.
Why should it care if I'm assigning it to a var variable?