mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Update README.md
This commit is contained in:
parent
9fcdaa0cec
commit
cedd69a6e9
34
README.md
34
README.md
@ -36,7 +36,7 @@ There are 16 methods under SqlSugarClient
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 👸Create SqlSugarClient
|
## 🎀Create SqlSugarClient
|
||||||
All operations are based on SqlSugarClient
|
All operations are based on SqlSugarClient
|
||||||
|
|
||||||
SqlSugarClient parameter and only one ConnectionConfig
|
SqlSugarClient parameter and only one ConnectionConfig
|
||||||
@ -81,7 +81,7 @@ public class Student
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/0.SqlSugarClient)
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/0.SqlSugarClient)
|
||||||
|
|
||||||
|
|
||||||
## 👸1. Queryable
|
## 🎉1. Queryable
|
||||||
We use it to query
|
We use it to query
|
||||||

|

|
||||||
|
|
||||||
@ -120,7 +120,7 @@ var list4 = db.Queryable<Student, School>((st, sc) =>new JoinQueryInfos(JoinTyp
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 👸2. Updateable
|
## 🎊2. Updateable
|
||||||
We use it to Update
|
We use it to Update
|
||||||
```cs
|
```cs
|
||||||
//update reutrn Update Count
|
//update reutrn Update Count
|
||||||
@ -142,7 +142,7 @@ var t9 = db.Updateable(it=>new class() { name="a",createtime=p }).Where(it => it
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/2.Updateable)
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/2.Updateable)
|
||||||
|
|
||||||
|
|
||||||
## 👸 3. Insertable
|
## 🎃 3. Insertable
|
||||||
We use it to Insert
|
We use it to Insert
|
||||||
```cs
|
```cs
|
||||||
//Insert reutrn Insert Count
|
//Insert reutrn Insert Count
|
||||||
@ -162,7 +162,7 @@ var s9 = db.Insertable(insertObjs).InsertColumns(it => new { it.Name }).ExecuteC
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/3.Insertable)
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/3.Insertable)
|
||||||
|
|
||||||
## 👸 4. Deleteable
|
## 🎄4. Deleteable
|
||||||
We use it to Delete
|
We use it to Delete
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
@ -182,7 +182,7 @@ db.Deleteable<Student>().Where(it => it.Id == 1).ExecuteCommand();
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/4.Deleteable )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/4.Deleteable )
|
||||||
|
|
||||||
|
|
||||||
## 👸5. SqlQueryable
|
## 🎋5. SqlQueryable
|
||||||
```cs
|
```cs
|
||||||
var list = db.SqlQueryable<Student>("select * from student").ToPageList(1, 2);
|
var list = db.SqlQueryable<Student>("select * from student").ToPageList(1, 2);
|
||||||
var list2 = db.SqlQueryable<Student>("select * from student").Where(it=>it.Id==1).ToPageList(1, 2);
|
var list2 = db.SqlQueryable<Student>("select * from student").Where(it=>it.Id==1).ToPageList(1, 2);
|
||||||
@ -190,7 +190,7 @@ var list3= db.SqlQueryable<Student>("select * from student").Where("id=@id",new
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/5.SqlQueryable )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/5.SqlQueryable )
|
||||||
|
|
||||||
## 👸6. SaveQueues
|
## 🎎6. SaveQueues
|
||||||
Perform multiple operations together with transactions
|
Perform multiple operations together with transactions
|
||||||
```cs
|
```cs
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
@ -212,7 +212,7 @@ var result2 = db.SaveQueues<Student, School, Student>();
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/6.queue )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/6.queue )
|
||||||
|
|
||||||
|
|
||||||
## 👸7.Ado
|
## 🎫7.Ado
|
||||||
db.Ado.MethodName,Look at the following example
|
db.Ado.MethodName,Look at the following example
|
||||||
```cs
|
```cs
|
||||||
var dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new List<SugarParameter>(){
|
var dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new List<SugarParameter>(){
|
||||||
@ -229,7 +229,7 @@ var dt2 = db.Ado.UseStoredProcedure().GetDataTable("sp_school",nameP,ageP);
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/7.ado )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/7.ado )
|
||||||
|
|
||||||
## 👸8.Saveable
|
## 🧶8.Saveable
|
||||||
Insert or Update
|
Insert or Update
|
||||||
```cs
|
```cs
|
||||||
db.Saveable<Student>(entity).ExecuteReturnEntity();
|
db.Saveable<Student>(entity).ExecuteReturnEntity();
|
||||||
@ -241,7 +241,7 @@ db.Saveable<Student>(new Student() { Name = "" })
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/8.saveable )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/8.saveable )
|
||||||
|
|
||||||
## 👸9.EntityMain
|
## 🛒9.EntityMain
|
||||||
```cs
|
```cs
|
||||||
var entityInfo=db.EntityMaintenance.GetEntityInfo<Student>();
|
var entityInfo=db.EntityMaintenance.GetEntityInfo<Student>();
|
||||||
foreach (var column in entityInfo.Columns)
|
foreach (var column in entityInfo.Columns)
|
||||||
@ -251,7 +251,7 @@ foreach (var column in entityInfo.Columns)
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/9.entityMain )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/9.entityMain )
|
||||||
|
|
||||||
## 👸10.DbMain
|
## 🥼10.DbMain
|
||||||
```cs
|
```cs
|
||||||
var tables = db.DbMaintenance.GetTableInfoList();
|
var tables = db.DbMaintenance.GetTableInfoList();
|
||||||
foreach (var table in tables)
|
foreach (var table in tables)
|
||||||
@ -262,7 +262,7 @@ foreach (var column in entityInfo.Columns)
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/a.DbMain )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/a.DbMain )
|
||||||
|
|
||||||
|
|
||||||
## 👸11.Aop
|
## 🦺11.Aop
|
||||||
```cs
|
```cs
|
||||||
db.Aop.OnLogExecuted = (sql, pars) => //SQL executed event
|
db.Aop.OnLogExecuted = (sql, pars) => //SQL executed event
|
||||||
{
|
{
|
||||||
@ -284,7 +284,7 @@ db.Aop.OnExecutingChangeSql = (sql, pars) => //SQL executing event (pre-exe
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/b.aop )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/b.aop )
|
||||||
|
|
||||||
## 👸12.QueryFilter
|
## 🎁12.QueryFilter
|
||||||
```cs
|
```cs
|
||||||
|
|
||||||
//gobal filter
|
//gobal filter
|
||||||
@ -308,7 +308,7 @@ public static SqlSugarClient GetInstance()
|
|||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/c.GobalFilter )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/c.GobalFilter )
|
||||||
|
|
||||||
## 👸13.DbFirst
|
## 🍔 13.DbFirst
|
||||||
```cs
|
```cs
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
//Create all class
|
//Create all class
|
||||||
@ -340,14 +340,14 @@ db.DbFirst.IsCreateAttribute().Where("Student").CreateClassFile("c:\\Demo\\5");
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/d.DbFirst )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/d.DbFirst )
|
||||||
|
|
||||||
|
|
||||||
## 👸 14.CodeFirst
|
## 🥙 14.CodeFirst
|
||||||
```cs
|
```cs
|
||||||
db.CodeFirst.SetStringDefaultLength(100).BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2)); //change entity backupTable
|
db.CodeFirst.SetStringDefaultLength(100).BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2)); //change entity backupTable
|
||||||
db.CodeFirst.SetStringDefaultLength(100).InitTables(typeof(CodeTable), typeof(CodeTable2));
|
db.CodeFirst.SetStringDefaultLength(100).InitTables(typeof(CodeTable), typeof(CodeTable2));
|
||||||
```
|
```
|
||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/e.CodeFirst )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/e.CodeFirst )
|
||||||
|
|
||||||
## 👸15.Utilities
|
## 🧈15.Utilities
|
||||||
```cs
|
```cs
|
||||||
var list = db.Utilities.DataTableToList(datatable);
|
var list = db.Utilities.DataTableToList(datatable);
|
||||||
```
|
```
|
||||||
@ -355,7 +355,7 @@ var list = db.Utilities.DataTableToList(datatable);
|
|||||||
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/f.Utilities )
|
[<font color=red>View more >> </font>](https://github.com/sunkaixuan/SqlSugar/wiki/f.Utilities )
|
||||||
|
|
||||||
|
|
||||||
## 👸16.SimpleClient
|
## 🥫16.SimpleClient
|
||||||
```cs
|
```cs
|
||||||
var db = GetInstance();
|
var db = GetInstance();
|
||||||
var sdb = db.GetSimpleClient<Student>();
|
var sdb = db.GetSimpleClient<Student>();
|
||||||
|
Loading…
Reference in New Issue
Block a user