我有带有 LINQ 的模型,它将返回 Rows。这里我在这个查询的模型类中的代码我想在视图中返回结果。我怎样才能做到这一点?
public void retNumRecord(string email, string fname,
string lname, string zip, string pref,
string address, string tel)
{
int _pref = Convert.ToInt32(pref);
var x = (from p in db.eduardo_member_t
where (p.email != null && p.email.Contains(email))
|| (p.fname != null && p.fname.Contains(fname))
|| (p.lname != null && p.lname.Contains(lname))
|| (p.zip != null && p.zip.Contains(zip))
|| (p.pref != null && p.pref == _pref)
|| (p.address != null && p.address.Contains(address))
|| (p.tel != null && p.tel.Contains(tel))
select p);
return x;
}