Skip to content

Commit 4b2887f

Browse files
2881028810
authored andcommitted
- 修复 父子关系导航属性 Dto 中直接使用 a.Parent 映射错误的 bug;
1 parent 023956d commit 4b2887f

File tree

3 files changed

+10
-34
lines changed

3 files changed

+10
-34
lines changed

FreeSql.DbContext/FreeSql.DbContext.xml

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeSql/Internal/CommonExpression.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,8 @@ public string ExpressionLambdaToSql(Expression exp, ExpTSC tsc)
11091109
var finds = new SelectTableInfo[0];
11101110
if (tsc.style == ExpressionStyle.SelectColumns)
11111111
{
1112-
finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray();
1112+
finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type && a.Alias == alias).ToArray();
1113+
if (finds.Length != 1) finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray();
11131114
if (finds.Any()) finds = new[] { finds.First() };
11141115
}
11151116
if (finds.Length != 1 && isa && parmExp != null)

readme.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -215,30 +215,6 @@ using (var ctx = new fsql.CreateDbContext()) {
215215
}
216216
```
217217

218-
# DataFilter & Tenant
219-
220-
```csharp
221-
public void ConfigureServices(IServiceCollection services) {
222-
services.AddSingleton<IFreeSql>(Fsql);
223-
services.AddFreeRepository(filter => filter
224-
.Apply<ISoftDelete>("SoftDelete", a => a.IsDeleted == false)
225-
.Apply<ITenant>("Tenant", a => a.TenantId == 1)
226-
,
227-
this.GetType().Assembly
228-
);
229-
}
230-
```
231-
232-
Temporary disable:
233-
```csharp
234-
var repoq = fsql.GetRepository<Song, int>();
235-
236-
using (repo1.DataFilter.Disable("Tenant")) {
237-
//Tenant Invalid
238-
}
239-
//Tenant restore
240-
```
241-
242218
# Performance
243219

244220
FreeSql Query & Dapper Query
@@ -265,7 +241,7 @@ Elapsed: 00:00:00.6707125; ToList Entity Counts: 131072; ORM: FreeSql*
265241
Elapsed: 00:00:00.6495301; Query Entity Counts: 131072; ORM: Dapper
266242
```
267243

268-
[Test code](FreeSql.Tests.PerformanceTests/MySqlAdoTest.cs)
244+
[Test code](FreeSql.Tests.PerformanceTests/MySqlAdoTest.cs)、[More](https://github.com/2881099/FreeSql/wiki/%e6%80%a7%e8%83%bd)
269245
270246
# Contributors
271247

@@ -282,4 +258,10 @@ Elapsed: 00:00:00.6495301; Query Entity Counts: 131072; ORM: Dapper
282258
[hd2y](https://github.com/hd2y)、
283259
[tky753](https://github.com/tky753)
284260
285-
QQ群:4336577
261+
QQ群:4336577
262+
263+
# Donation
264+
265+
L*y 58元、花花 88 元、麦兜很乖 50元、网络来者 2000
266+
267+
<img height="210" src="https://images.cnblogs.com/cnblogs_com/kellynic/133561/o_200123075118IMG_7935(20200123-154947).JPG"/>

0 commit comments

Comments
 (0)