SqliteDataContext.SqliteDataContext(IDataContextOptions dataContextOptions) Constructor
.NET Standard 2.x
Initializes a new instance of the SqliteDataContext class by passing the SqliteDataContextOptions type object as a parameter.
Namespace: SnapObjects.Data.Sqlite
Assembly: SnapObjects.Data.Sqlite.dll
Syntax
public SqliteDataContext(IDataContextOptions dataContextOptions) : base(dataContextOptions)
Parameters
dataContextOptions
SnapObjects.Data.IDataContextOptions
The options to be set for the DataContext
object.
Examples
The following code example uses the SqliteDataContextOptions
object to initialize an instance of the SqliteDataContext
class.
using Appeon.ApiDoc.Models;
using Sqlite.ManagedDataAccess.Client;
using SnapObjects.Data;
using SnapObjects.Data.Sqlite;
using System;
namespace Appeon.ApiDoc.SqliteDataContextExamples
{
public class SqliteDataContextExample
{
public void Example1()
{
var dataContext = new SqliteDataContext(new SqliteDataContextOptions(CONNECTION_STRING));
Console.WriteLine(dataContext.ContextOptions.DatabaseType);
/*This code produces the following output:
Sqlite
*/
}
}
}
Applies to
.NET Standard
2.x