EF查询 linq

//Student.cs
public int Id{get;set;} public string name{get;set;} //SchoolContext.cs public class SchoolContext : DbContext { public SchoolContext() : base("SchoolContext") { } public DbSet<Student> Student { get; set; } } //查询ID=1 SchoolContext Db=new SchoolContext(); List<Student> list=Db.Student.ToList(); list.where(a => a.ID== 1)

 

posted @ 2015-10-25 00:09  gobuild  阅读(343)  评论(0编辑  收藏  举报