var user = from u in db.UserManage
where (string.IsNullOrEmpty(age)) ? true : (u.age == a)
&& (string.IsNullOrEmpty(userName)) ? true : u.userName.Contains(userName)
select u;
-------------------------------------------------
var user = from u in db.UserManage
where (string.IsNullOrEmpty(userName)) ? true : u.userName.Contains(userName)
&& (string.IsNullOrEmpty(age)) ? true : (u.age == a)
select u;
var user = from u in db.UserManage select u;
if(!string.IsNullOrEmpty(age))
user=user.Where(u=>u.age == age);
if(!string.IsNullOrEmpty(userName))
user=user.Where(u=>u.userName.Contains(userName));