Update README.md

This commit is contained in:
sunkaixuan 2018-02-03 17:18:24 +08:00 committed by GitHub
parent 69bc2f6ec1
commit 74ea5aa30d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,6 @@ https://github.com/sunkaixuan/SqlSugar/tree/master
//Create DbContext
public class DbContext
{
public SqlSugarClient db;
public DbContext()
{
db = new SqlSugarClient(new ConnectionConfig()
@ -39,8 +38,9 @@ public class DbContext
IsAutoCloseConnection = true
});
}
public SimpleClient<Student> StudentDb { get { return new SimpleClient<Student>(db); } }
public SimpleClient<School> SchoolDb { get { return new SimpleClient<School>(db); } }
public SqlSugarClient Db;
public SimpleClient<Student> StudentDb { get { return new SimpleClient<Student>(Db); } }
public SimpleClient<School> SchoolDb { get { return new SimpleClient<School>(Db); } }
}
public class Business : DbContext
{
@ -48,8 +48,8 @@ public class Business : DbContext
public void GetAll()
{
//use db get student list
List<Student> list= db.Queryable<Student>().ToList();
//use Db get student list
List<Student> list= Db.Queryable<Student>().ToList();
//use StudentDb get student list
List<Student> list2=StudentDb.GetList();