以下のSQLクエリをLINQクエリに変換しようとしています
Qry = "select Announcement, StartDate, Enddate,Annkey from
Announcements "; Qry = Qry & " where Startdate <= #" & Today & "# "
Qry = Qry & " and Enddate >= #" & Today & "# " Qry = Qry + " order by
StartDate, Enddate";
今まで作ってきたもの -
public bool Selectdatafromannouncements()
{
List<Announcement> lstAnnounce = new List<Announcement>(
from l in objVaccinationContext.Announcements
where
l.StartDate.Value < DateTime.Today
&& l.EndDate.Value < DateTime.Today
orderby l.StartDate, l.EndDate
select new (l.Announcement1, l.StartDate, l.EndDate, l.AnnouncementID)
);
return true;
}
select new の近くでエラーが発生しました (タイプが予想されるので、私を助けてください私はLINQの初心者です