mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update README.md
This commit is contained in:
parent
69bc2f6ec1
commit
74ea5aa30d
10
README.md
10
README.md
@ -29,7 +29,6 @@ https://github.com/sunkaixuan/SqlSugar/tree/master
|
|||||||
//Create DbContext
|
//Create DbContext
|
||||||
public class DbContext
|
public class DbContext
|
||||||
{
|
{
|
||||||
public SqlSugarClient db;
|
|
||||||
public DbContext()
|
public DbContext()
|
||||||
{
|
{
|
||||||
db = new SqlSugarClient(new ConnectionConfig()
|
db = new SqlSugarClient(new ConnectionConfig()
|
||||||
@ -39,8 +38,9 @@ public class DbContext
|
|||||||
IsAutoCloseConnection = true
|
IsAutoCloseConnection = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public SimpleClient<Student> StudentDb { get { return new SimpleClient<Student>(db); } }
|
public SqlSugarClient Db;
|
||||||
public SimpleClient<School> SchoolDb { get { return new SimpleClient<School>(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
|
public class Business : DbContext
|
||||||
{
|
{
|
||||||
@ -48,8 +48,8 @@ public class Business : DbContext
|
|||||||
public void GetAll()
|
public void GetAll()
|
||||||
{
|
{
|
||||||
|
|
||||||
//use db get student list
|
//use Db get student list
|
||||||
List<Student> list= db.Queryable<Student>().ToList();
|
List<Student> list= Db.Queryable<Student>().ToList();
|
||||||
|
|
||||||
//use StudentDb get student list
|
//use StudentDb get student list
|
||||||
List<Student> list2=StudentDb.GetList();
|
List<Student> list2=StudentDb.GetList();
|
||||||
|
Loading…
Reference in New Issue
Block a user