Add db.Ado.IsValidConnectionNoClose

This commit is contained in:
sunkaixuan
2022-08-10 14:25:20 +08:00
parent 0faf462549
commit ba451b478b
2 changed files with 13 additions and 0 deletions

View File

@@ -87,6 +87,18 @@ namespace SqlSugar
return false;
}
}
public virtual bool IsValidConnectionNoClose()
{
try
{
this.Open();
return true;
}
catch (Exception)
{
return false;
}
}
public virtual void Open()
{
CheckConnection();

View File

@@ -165,6 +165,7 @@ namespace SqlSugar
void Open();
SugarConnection OpenAlways();
bool IsValidConnection();
bool IsValidConnectionNoClose();
void CheckConnection();
void BeginTran();