mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 优化 Sqlite 默认使用 AdoPool;
This commit is contained in:
parent
37a4b13046
commit
d6823b6a21
@ -600,6 +600,8 @@ namespace base_entity
|
|||||||
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
|
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var testr1 = fsql.Ado.ExecuteConnectTest();
|
||||||
|
|
||||||
var dict = new List<Dictionary<string, object>>();
|
var dict = new List<Dictionary<string, object>>();
|
||||||
Dictionary<string, object> d = new Dictionary<string, object>();
|
Dictionary<string, object> d = new Dictionary<string, object>();
|
||||||
d.Add("id", 2);
|
d.Add("id", 2);
|
||||||
|
@ -733,15 +733,6 @@
|
|||||||
<param name="modelBuilder"></param>
|
<param name="modelBuilder"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:FreeSqlDbContextExtensions.ApplyConfigurationsFromAssembly(FreeSql.ICodeFirst,System.Reflection.Assembly,System.Func{System.Type,System.Boolean})">
|
|
||||||
<summary>
|
|
||||||
根据Assembly扫描所有继承IEntityTypeConfiguration<T>的配置类
|
|
||||||
</summary>
|
|
||||||
<param name="codeFirst"></param>
|
|
||||||
<param name="assembly"></param>
|
|
||||||
<param name="predicate"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:FreeSqlDbContextExtensions.CreateDbContext(IFreeSql)">
|
<member name="M:FreeSqlDbContextExtensions.CreateDbContext(IFreeSql)">
|
||||||
<summary>
|
<summary>
|
||||||
创建普通数据上下文档对象
|
创建普通数据上下文档对象
|
||||||
@ -800,14 +791,5 @@
|
|||||||
<param name="that"></param>
|
<param name="that"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Microsoft.Extensions.DependencyInjection.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>
|
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
|
@ -24,7 +24,7 @@ namespace FreeSql
|
|||||||
bool _isLazyLoading = false;
|
bool _isLazyLoading = false;
|
||||||
bool _isExitAutoDisposePool = true;
|
bool _isExitAutoDisposePool = true;
|
||||||
bool _isQuoteSqlName = true;
|
bool _isQuoteSqlName = true;
|
||||||
bool _isAdoConnectionPool = false;
|
bool? _isAdoConnectionPool = null;
|
||||||
MappingPriorityType[] _mappingPriorityTypes;
|
MappingPriorityType[] _mappingPriorityTypes;
|
||||||
NameConvertType _nameConvertType = NameConvertType.None;
|
NameConvertType _nameConvertType = NameConvertType.None;
|
||||||
Action<DbCommand> _aopCommandExecuting = null;
|
Action<DbCommand> _aopCommandExecuting = null;
|
||||||
@ -370,9 +370,13 @@ namespace FreeSql
|
|||||||
default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
|
default: throw new Exception(CoreStrings.NotSpecified_UseConnectionString_UseConnectionFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var isAdoPool = false;
|
||||||
|
if (_isAdoConnectionPool != null) isAdoPool = _isAdoConnectionPool.Value;
|
||||||
|
else if (_dataType == DataType.Sqlite) isAdoPool = true; //sqlite 默认使用 Ado Pool
|
||||||
|
else isAdoPool = false;
|
||||||
ret = Activator.CreateInstance(type, new object[]
|
ret = Activator.CreateInstance(type, new object[]
|
||||||
{
|
{
|
||||||
_isAdoConnectionPool ? $"AdoConnectionPool,{_masterConnectionString}" : _masterConnectionString,
|
isAdoPool ? $"AdoConnectionPool,{_masterConnectionString}" : _masterConnectionString,
|
||||||
_slaveConnectionString,
|
_slaveConnectionString,
|
||||||
_connectionFactory
|
_connectionFactory
|
||||||
}) as IFreeSql<TMark>;
|
}) as IFreeSql<TMark>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user