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>();
}