B_Apply
public List<Apply> RiskLink(Expression<Func<Apply, bool>> where)
{
using (var dbContext = new DBContext())
{
var query = dbContext.ApplyDs.Include(m => m.User).Where(where);
return query.ToList();
}
}
public ActionResult RiskLinkDetail01(string name,string idcard)
{
List<Apply> listApply = new B_Apply().RiskLink(m => m.User.Name == name && m.Account.IDCard == idcard);
var result = from item in listApply
select new
{
ApplyTime = item.ApplyTime.ToString("yyyy-MM-dd HH:mm:ss"),
Amounts = item.Amounts
};
return Json(new { total = listApply.Count, rows = result });
}
C#: from in select ; m(linq where)
最新推荐文章于 2024-04-25 11:21:04 发布