add ToTreeList tests #268

This commit is contained in:
28810
2020-04-10 13:09:08 +08:00
parent f9566af7d1
commit 4e4240ff7a
24 changed files with 1291 additions and 283 deletions

View File

@ -43,7 +43,7 @@ namespace FreeSql
if (_optionsPriv == null)
{
_optionsPriv = new DbContextOptions();
if (FreeSqlDbContextExtensions._dicSetDbContextOptions.TryGetValue(Orm, out var opt))
if (FreeSqlDbContextExtensions._dicSetDbContextOptions.TryGetValue(Orm.Ado.Identifier, out var opt))
{
_optionsPriv.EnableAddOrUpdateNavigateList = opt.EnableAddOrUpdateNavigateList;
_optionsPriv.OnEntityChange = opt.OnEntityChange;

View File

@ -35,10 +35,10 @@ public static class FreeSqlDbContextExtensions
public static IFreeSql SetDbContextOptions(this IFreeSql that, Action<DbContextOptions> options)
{
if (options == null) return that;
var cfg = _dicSetDbContextOptions.GetOrAdd(that, t => new DbContextOptions());
var cfg = _dicSetDbContextOptions.GetOrAdd(that.Ado.Identifier, t => new DbContextOptions());
options(cfg);
_dicSetDbContextOptions.AddOrUpdate(that, cfg, (t, o) => cfg);
_dicSetDbContextOptions.AddOrUpdate(that.Ado.Identifier, cfg, (t, o) => cfg);
return that;
}
internal static ConcurrentDictionary<IFreeSql, DbContextOptions> _dicSetDbContextOptions = new ConcurrentDictionary<IFreeSql, DbContextOptions>();
internal static ConcurrentDictionary<Guid, DbContextOptions> _dicSetDbContextOptions = new ConcurrentDictionary<Guid, DbContextOptions>();
}

View File

@ -121,13 +121,6 @@
清空状态数据
</summary>
</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)">
<summary>
添加
@ -222,15 +215,6 @@
</summary>
<returns></returns>
</member>
<member name="M:FreeSql.FreeSqlRepositoryDependencyInjection.AddFreeRepository(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{FreeSql.FluentDataFilter},System.Reflection.Assembly[])">
<summary>
批量注入 Repository可以参考代码自行调整
</summary>
<param name="services"></param>
<param name="globalDataFilter"></param>
<param name="assemblies"></param>
<returns></returns>
</member>
<member name="P:FreeSql.IBaseRepository.Orm">
<summary>
注意IFreeSql 属于顶级对象,事务无法自动传递。<para></para>