- 修复 父子关系导航属性 Dto 中直接使用 a.Parent 映射错误的 bug;

This commit is contained in:
28810 2020-01-23 15:53:11 +08:00
parent 023956d704
commit 4b2887f607
3 changed files with 10 additions and 34 deletions

View File

@ -110,13 +110,6 @@
清空状态数据 清空状态数据
</summary> </summary>
</member> </member>
<member name="M:FreeSql.DbSet`1.RemoveAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
<summary>
根据 lambda 条件删除数据
</summary>
<param name="predicate"></param>
<returns></returns>
</member>
<member name="M:FreeSql.DbSet`1.Add(`0)"> <member name="M:FreeSql.DbSet`1.Add(`0)">
<summary> <summary>
添加 添加

View File

@ -1109,7 +1109,8 @@ namespace FreeSql.Internal
var finds = new SelectTableInfo[0]; var finds = new SelectTableInfo[0];
if (tsc.style == ExpressionStyle.SelectColumns) if (tsc.style == ExpressionStyle.SelectColumns)
{ {
finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray(); finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type && a.Alias == alias).ToArray();
if (finds.Length != 1) finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray();
if (finds.Any()) finds = new[] { finds.First() }; if (finds.Any()) finds = new[] { finds.First() };
} }
if (finds.Length != 1 && isa && parmExp != null) if (finds.Length != 1 && isa && parmExp != null)

View File

@ -215,30 +215,6 @@ using (var ctx = new fsql.CreateDbContext()) {
} }
``` ```
# DataFilter & Tenant
```csharp
public void ConfigureServices(IServiceCollection services) {
services.AddSingleton<IFreeSql>(Fsql);
services.AddFreeRepository(filter => filter
.Apply<ISoftDelete>("SoftDelete", a => a.IsDeleted == false)
.Apply<ITenant>("Tenant", a => a.TenantId == 1)
,
this.GetType().Assembly
);
}
```
Temporary disable:
```csharp
var repoq = fsql.GetRepository<Song, int>();
using (repo1.DataFilter.Disable("Tenant")) {
//Tenant Invalid
}
//Tenant restore
```
# Performance # Performance
FreeSql Query & Dapper Query FreeSql Query & Dapper Query
@ -265,7 +241,7 @@ Elapsed: 00:00:00.6707125; ToList Entity Counts: 131072; ORM: FreeSql*
Elapsed: 00:00:00.6495301; Query Entity Counts: 131072; ORM: Dapper Elapsed: 00:00:00.6495301; Query Entity Counts: 131072; ORM: Dapper
``` ```
[Test code](FreeSql.Tests.PerformanceTests/MySqlAdoTest.cs) [Test code](FreeSql.Tests.PerformanceTests/MySqlAdoTest.cs)、[More](https://github.com/2881099/FreeSql/wiki/%e6%80%a7%e8%83%bd)
# Contributors # Contributors
@ -283,3 +259,9 @@ Elapsed: 00:00:00.6495301; Query Entity Counts: 131072; ORM: Dapper
[tky753](https://github.com/tky753) [tky753](https://github.com/tky753)
QQ群4336577 QQ群4336577
# Donation
L*y 58元、花花 88 元、麦兜很乖 50元、网络来者 2000元
<img height="210" src="https://images.cnblogs.com/cnblogs_com/kellynic/133561/o_200123075118IMG_7935(20200123-154947).JPG"/>