日期:2014-05-20 浏览次数:20752 次
pubilc list<c> FindList(string name, int? type) { using(var context = Factory.Create()) { var query = context.A; if(name != null) query = query.Where(x => x.Name.Contains(name)); if(type != null && type.HasValue) query = query.Where(x => x.Type == type.Value); var result = from p in query from q in context.B where p.ID == q.ID select ... return result.ToList(); } }