Skip to content

Commit

Permalink
复用构造函数
Browse files Browse the repository at this point in the history
  • Loading branch information
imba-tjd authored Jul 14, 2020
1 parent 2b72495 commit 1dc1dc7
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions SQLHelperLibrary/SQLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,7 @@ public SQLHelper(string dataSource)
/// <summary>
/// 专用于游戏库的初始化
/// </summary>
public SQLHelper()
{
var dataSource = $"{Environment.CurrentDirectory}\\MisakaGameLibrary.sqlite";
var connectionStringBuilder = new SQLiteConnectionStringBuilder
{
Version = 3,
Pooling = true,
FailIfMissing = false,
DataSource = dataSource
};
try
{
var mConnectionString = connectionStringBuilder.ConnectionString;
_mDbConnection = new SQLiteConnection(mConnectionString);
}
catch (Exception ex)
{
throw ex;
}
}
public SQLHelper() : this($"{Environment.CurrentDirectory}\\MisakaGameLibrary.sqlite") { }


/// <summary>
Expand Down

0 comments on commit 1dc1dc7

Please sign in to comment.