Request information about movie from IMDB.
using System.Data;
using System.Data.SQLite;
namespace MovieNavigator.Core
{
public class DatabaseService : IDatabaseService
{
public static SQLiteConnection Connection => new SQLiteConnection(Properties.ConnectionString);
public static SQLiteConnection SqlConn()
{
var dbConnection = Connection;
if (dbConnection.State != ConnectionState.Open)
dbConnection.Open();
return dbConnection;
}
void IDatabaseService.ExecuteCommand(SQLiteCommand cmd)
{
ExecuteCommand(cmd);
}
SQLiteConnection IDatabaseService.SqlConn()
{
return SqlConn();
}
public static void ExecuteCommand(SQLiteCommand cmd)
{
cmd.Connection = SqlConn();
cmd.ExecuteNonQuery();
}
}
}