SqliteDataContextOptions<TAdoDbContext>.SqliteDataContextOptions(string connectionString) Constructor
.NET Standard 2.x
Initializes a new instance of the SqliteDataContextOptions<TAdoDbContext> class by passing the connection string as a parameter.
Namespace: SnapObjects.Data.Sqlite
Assembly: SnapObjects.Data.Sqlite.dll
Syntax
public SqliteDataContextOptions(string connectionString) : base(connectionString)
Parameters
connectionString
System.String
A string containing connection information about how to connect to the data source.
Examples
The following code example uses a connection string to initialize an instance of the SqliteDataContextOptions<SqliteContext>
class.
using Appeon.ApiDoc.Models;
using SnapObjects.Data;
using SnapObjects.Data.Sqlite;
using System;
namespace Appeon.ApiDoc.SqliteDataContextOptions_GenericExamples
{
public class SqliteDataContextOptions_GenericExample
{
public void Example()
{
var options = new SqliteDataContextOptions<SqliteContext>(CONNECTION_STRING);
var dataContext = new SqliteDataContext(options);
Console.WriteLine(dataContext.ContextOptions.DatabaseType);
/*This code produces the following output:
Sqlite
*/
}
}
}
Applies to
.NET Standard
2.x