diff --git a/Falcon.SugarApi/DatabaseManager/DbContextBase.cs b/Falcon.SugarApi/DatabaseManager/DbContextBase.cs index d165f59..dd2dc78 100644 --- a/Falcon.SugarApi/DatabaseManager/DbContextBase.cs +++ b/Falcon.SugarApi/DatabaseManager/DbContextBase.cs @@ -23,5 +23,9 @@ namespace Falcon.SugarApi.DatabaseManager this.Logger = service.GetService(typeof(ILogger<>).MakeGenericType(GetType())) as ILogger ?? throw new NullReferenceException("ILogger"); } + /// + /// 是否能连接到数据库 + /// + public bool CanConnection => this.Ado.IsValidConnection(); } } diff --git a/Falcon.SugarApi/DatabaseManager/Readme.md b/Falcon.SugarApi/DatabaseManager/Readme.md new file mode 100644 index 0000000..c2b39d2 --- /dev/null +++ b/Falcon.SugarApi/DatabaseManager/Readme.md @@ -0,0 +1 @@ +## ݿ \ No newline at end of file