System.Data.SQLite.Core support in GetSqlType()

GetSqlType() does not recognise System.Data.SQLite.Core because the type of the SQL connection class has been renamed to `SQLiteConnection` from `SqliteConnection`.  This commit adds support for both, so that the DB manager classes can operate with plugins which reference the new SQLite ADO.net providers from NuGet.
This commit is contained in:
Tyler Watson 2017-04-14 17:33:48 +10:00
parent 5183190745
commit a102551588

View file

@ -111,7 +111,7 @@ namespace TShockAPI.DB
public static SqlType GetSqlType(this IDbConnection conn) public static SqlType GetSqlType(this IDbConnection conn)
{ {
var name = conn.GetType().Name; var name = conn.GetType().Name;
if (name == "SqliteConnection") if (name == "SqliteConnection" || name == "SQLiteConnection")
return SqlType.Sqlite; return SqlType.Sqlite;
if (name == "MySqlConnection") if (name == "MySqlConnection")
return SqlType.Mysql; return SqlType.Mysql;