您的位置:首页 > 编程语言 > C#

C#: from in select ; m(linq where)

2014-06-25 11:19 337 查看
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 });
}



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐