SqliteDataContextOptions.SqliteDataContextOptions(string connectionString) Constructor
.NET Standard 2.x
Initializes a new instance of the SqliteDataContextOptions class by passing the connection string as a parameter.
Namespace: SnapObjects.Data.Sqlite
Assembly: SnapObjects.Data.Sqlite.dll
Syntax
public SqliteDataContextOptions(string connectionString) : base(DatabaseType.Sqlite)
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
class.
using Appeon.ApiDoc.Models;
using SnapObjects.Data;
using SnapObjects.Data.Sqlite;
using System;
namespace Appeon.ApiDoc.SqliteDataContextOptionsExamples
{
public class SqliteDataContextOptionsExample
{
public void Example()
{
var options = new SqliteDataContextOptions(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