I wanted use servicestack.ormlite to connect to the database.But I get this error even after adding the refrence from Nuget.
I used this command to install
Install-Package ServiceStack.OrmLite.SqlServer
This is the error thrown
'ServiceStack.Data.IDbConnectionFactory' does not contain a definition for 'Open' and no extension method 'Open' accepting a first argument of type 'ServiceStack.Data.IDbConnectionFactory' could be found (are you missing a using directive or an assembly reference?)
var dbFactory = new OrmLiteConnectionFactory(connectionString, SqliteDialect.Provider);
//I get error when I call open method
using (IDbConnection db = dbFactory.Open())
{
}
The
IDbConnectionFactory.Open()
extension method is defined in OrmLiteConnectionFactoryExtensions that's defined underServiceStack.OrmLite
namespace so you need to import: