ENTRY라는 표 (& EntitySet)에서의 최신 메시지를 게시 얻을 것으로 예상되는이 방법을 가지고 /// 방법은 "일 얻는 LINQ 쿼리 내에서 DateTime.HasValue을 확인 "매개 변수로 새 TimeSpan (days, 0,0,0)에 사용됨 !!
using (Entities db = new Entities())
{
var entries = from ent in db.ENTRY
where ent.DATECREATE.Value > DateTime.Today.Subtract(new TimeSpan(days, 0, 0, 0))
select new ForumEntryGridView()
{
id = ent.id,
baslik = ent.header,
tarih = ent.entrydate.Value,
membername = ent.Member.ToString()
};
return entries.ToList<ForumEntryGridView>();
}
여기서 DATECREATED는 데이터베이스에서 Nullable입니다. 나는이 쿼리에서 if if place를 찾을 수 없다.
는 "나는 확실하지 오전"대답은 그 방법이기 때문에 그것이 않는다는 것입니다 '||'는 작동합니다. – Domenic