Updated With Sql (markdown)

AlexLEWIS
2021-09-27 13:34:22 +08:00
parent fd372a69bd
commit 1663c7cc78

@@ -1,8 +1,9 @@
[中文](withsql) | **English**
# WithSql 自定义SQL
# Use Custom SQL Statements
Define entity class:
定义实体类
```csharp
public class TestClass
{
@@ -23,13 +24,13 @@
}
```
不同的查询方式。
- 返回`DataTable`
- 返回`List<Tuplue>` `List<(string,string)>`元组
- 返回`List<object>` 且能支持分页
- 返回`List<TestClassDto>`且能支持分页
Different query results:
- Return to `DataTable`.
- Return `List<Tuplue>` i.e. `List<(string,string)>` tuple.
- Return `List<object>` and support paging.
- Return `List<TestClassDto>` and support paging.
### 1.返回DataTable
### Return to DataTable with specified columns
```csharp
DataTable dt1 = _fsql.Select<object>()
@@ -42,7 +43,7 @@ SELECT ID,Age
FROM(select * from TestClass ) a
```
### 2.返回DataTable
### Return to DataTable with all columns
```csharp
DataTable dt2 = _fsql.Select<object>()
@@ -54,7 +55,7 @@ SELECT *
FROM ( select * from TestClass ) a
```
### 3.返回`List<Tuplue>` 即`List<(string,string)>` 元组
### Return List\<Tuple\> (i.e. List\<(string, string)\>)
```csharp
List<(string,string)> list1 = _fsql
@@ -68,7 +69,7 @@ SELECT ID, Age
FROM(select * from TestClass ) a
```
### 4.返回`List<object>`
### Return List\<object\>
```csharp
var list2 = _fsql.Select<object>()
@@ -80,7 +81,7 @@ SELECT *
FROM(select * from TestClass ) a
```
### 5.返回`List<object>` 且能支持分页
### Return List\<object\> and support paging
```csharp
var list3 = _fsql.Select<object>()
@@ -97,7 +98,7 @@ SELECT ID, Age
limit 0,10
```
### 6.返回`List<TestClassDto>`且能支持分页
### Return List\<TestClassDto\> and support paging
```csharp
var list4 = _fsql.Select<object>()