3
假設查詢中有5條記錄,我如何獲得前1條記錄?這是我現在的代碼。如何從查詢中獲得前1條記錄
public Application GetByUserIdAndVersion(int userId, string version)
{
VettingDataContext dc = new VettingDataContext(_connString);
return (from a in dc.Applications
where a.UserId == userId && a.chr_Version == version
select a).SingleOrDefault<Application>();
}