日期:2014-05-20  浏览次数:20676 次

linq查询转换问题
var v = (from i in dc.Info
  where i.moduleID == 4
  orderby i.createDate descending
  select new
  {
  infoID = i.infoID,
  infoContent = i.infoContent1,
  }).Take(1);

怎么把这查出来的var转成Info类型啊?

------解决方案--------------------
var info = dc.Info.OrderByDescending(i => i.createDate).FirstOrDefault(i => i.moduleID == 4);