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> BlogArt
{
get;
set;
}
}
查询ID=1
SchoolContext Db=new SchoolContext(); List<Student> list=Db.Student.ToList(); list.where(a => a.ID== 1)
原文:http://www.cnblogs.com/gobuild/p/4908087.html