mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-03-15 10:30:57 +08:00
Merge branch 'master' of https://github.com/2881099/FreeSql.wiki
2
Home.md
2
Home.md
@@ -12,7 +12,7 @@ QQ群:4336577(已满)、8578575(在线)、52508226(在线)
|
||||
- [x] 支持导航属性查询,和延时加载;
|
||||
- [x] 支持同步/异步数据库操作方法,丰富多彩的链式查询方法;
|
||||
- [x] 支持读写分离、分表分库,租户设计;
|
||||
- [x] 支持多种数据库,MySql/SqlServer/PostgreSQL/Oracle/Sqlite/Firebird/达梦/神通/人大进仓/MsAccess;
|
||||
- [x] 支持多种数据库,MySql/SqlServer/PostgreSQL/Oracle/Sqlite/Firebird/达梦/神通/人大金仓/MsAccess;
|
||||
|
||||
## 学习指南
|
||||
|
||||
|
||||
26
过滤器.md
26
过滤器.md
@@ -115,7 +115,7 @@ public class Song {
|
||||
public string Title { get; set; }
|
||||
}
|
||||
//在控制器使用
|
||||
public SongsController(GuidRepository<Song> repo1, GuidRepository<xxxx> repos2) {
|
||||
public SongsController(IBaseRepository<Song> repo1, IBaseRepository<xxxx> repos2) {
|
||||
//在此打断点,调试
|
||||
}
|
||||
```
|
||||
@@ -123,24 +123,30 @@ public SongsController(GuidRepository<Song> repo1, GuidRepository<xxxx> repos2)
|
||||
第一次请求:
|
||||
|
||||
repo1.Select.ToSql()
|
||||
> "SELECT a."Id", a."Title" \r\nFROM "Song" a \r\nWHERE (a."Title" = strftime('%Y-%m-%d %H:%M.%f',datetime(current_timestamp,'localtime')) || 21)"
|
||||
|
||||
```
|
||||
"SELECT a."Id", a."Title" FROM "Song" a WHERE (a."Title" = strftime('%Y-%m-%d %H:%M.%f',datetime(current_timestamp,'localtime')) || 21)"
|
||||
```
|
||||
repos2.Select.ToSql()
|
||||
>"SELECT a."Id" \r\nFROM "xxxx" a"
|
||||
|
||||
```
|
||||
"SELECT a."Id" FROM "xxxx" a"
|
||||
```
|
||||
第二次请求:
|
||||
|
||||
repo1.Select.ToSql()
|
||||
>"SELECT a."Id", a."Title" \r\nFROM "Song" a \r\nWHERE (a."Title" = strftime('%Y-%m-%d %H:%M.%f',datetime(current_timestamp,'localtime')) || 4)"
|
||||
|
||||
```
|
||||
"SELECT a."Id", a."Title" FROM "Song" a WHERE (a."Title" = strftime('%Y-%m-%d %H:%M.%f',datetime(current_timestamp,'localtime')) || 4)"
|
||||
```
|
||||
repos2.Select.ToSql()
|
||||
>"SELECT a."Id" \r\nFROM "xxxx" a"
|
||||
|
||||
```
|
||||
"SELECT a."Id" FROM "xxxx" a"
|
||||
```
|
||||
//禁用过滤器
|
||||
repo1.DataFilter.Disable("test")
|
||||
|
||||
repo1.Select.ToSql()
|
||||
> "SELECT a."Id", a."Title" \r\nFROM "Song" a"
|
||||
```
|
||||
"SELECT a."Id", a."Title" FROM "Song" a"
|
||||
```
|
||||
|
||||
1、注入的变量值在使用时有了动态变化,每次获取时都是新的(Thread.CurrentThread.ManagedThreadId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user