我正在尝试使用MySQL实现数据库连接上的工厂模式,SQL Server面临奇怪的错误
你调用的对象是空的
在SQL命令对象上
internal class SqlServerDB : IDatabase
{
private SqlConnection _Connection = null;
private SqlCommand _Command = null;
public IDbCommand Command
{
get
{
if (_Command == null)
{
_Command.Connection = (SqlConnection)Connection;
//_Command = new SqlCommand();
}
return _Command;
}
}
public IDbConnection Connection
{
get
{
if (_Connection == null)
{
string connectionString = ConfigurationManager.ConnectionStrings["testSQL"].ConnectionString;
_Connection = new SqlConnection(connectionString);
}
return _Connection;
}
}
}
Run Code Online (Sandbox Code Playgroud)
数据库工厂部分:
public static class DatabaseFactory
{
public static IDatabase CreateDatabase(DBType type)
{ …
Run Code Online (Sandbox Code Playgroud) 我是使用 jekyll 的新手,并尝试将minimal-mistakes-jekyll
主题安装为 gem。将 gem 添加minimal-mistakes-jekyll
到我的 gemfile 中,使用 bundle 命令更新它,并将其设置为 _config.yml 中创建的目录中的主题,jekyll new mywebsite
但是当我尝试运行 bundle exec jekyll serve 时它给了我这个错误:
/home/theo/gems/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:14:in
`':未初始化的常量 Faraday::Error::ClientError (NameError) 你的意思是?法拉第::客户端错误
当我尝试使用不同版本的 jekyll 时,这种情况仍然存在。我不知道如何解决这个问题,任何帮助将不胜感激!运行 Ubuntu 19.04 和 ruby 2.5.5,如果有用的话。