mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 FreeSqlBuilder.UseExitAutoDisposePool 方法;
This commit is contained in:
@ -755,6 +755,14 @@
|
||||
<param name="convertType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:FreeSql.FreeSqlBuilder.UseExitAutoDisposePool(System.Boolean)">
|
||||
<summary>
|
||||
监听 AppDomain.CurrentDomain.ProcessExit/Console.CancelKeyPress 事件自动释放连接池<para></para>
|
||||
默认值: true
|
||||
</summary>
|
||||
<param name="value"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:FreeSql.FreeSqlBuilder.UseSyncStructureToLower(System.Boolean)">
|
||||
<summary>
|
||||
转小写同步结构
|
||||
|
@ -22,6 +22,7 @@ namespace FreeSql
|
||||
bool _isNoneCommandParameter = false;
|
||||
bool _isGenerateCommandParameterWithLambda = false;
|
||||
bool _isLazyLoading = false;
|
||||
bool _isExitAutoDisposePool = true;
|
||||
StringConvertType _entityPropertyConvertType = StringConvertType.None;
|
||||
NameConvertType _nameConvertType = NameConvertType.None;
|
||||
Action<DbCommand> _aopCommandExecuting = null;
|
||||
@ -151,6 +152,18 @@ namespace FreeSql
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 监听 AppDomain.CurrentDomain.ProcessExit/Console.CancelKeyPress 事件自动释放连接池<para></para>
|
||||
/// 默认值: true
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public FreeSqlBuilder UseExitAutoDisposePool(bool value)
|
||||
{
|
||||
_isExitAutoDisposePool = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IFreeSql Build() => Build<IFreeSql>();
|
||||
public IFreeSql<TMark> Build<TMark>()
|
||||
{
|
||||
@ -374,6 +387,9 @@ namespace FreeSql
|
||||
e.ModifyResult.Name = $"{schema}.{e.EntityType.Name}";
|
||||
}
|
||||
});
|
||||
|
||||
ret.Ado.MasterPool.Policy.IsAutoDisposeWithSystem = _isExitAutoDisposePool;
|
||||
ret.Ado.SlavePools.ForEach(a => a.Policy.IsAutoDisposeWithSystem = _isExitAutoDisposePool);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user