📅  最后修改于: 2022-03-11 14:48:42.949000             🧑  作者: Mango
class ProjectInfo
{
public string Name {get; set; }
public long Id {get; set; }
}
public List GetProjectForCombo()
{
using (MyDataContext db = new MyDataContext (DBHelper.GetConnectionString()))
{
var query = from pro in db.Projects
select new ProjectInfo(){ Name = pro.ProjectName, Id = pro.ProjectId };
return query.ToList();
}
}