File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,34 @@ public class MyContext : DbContext
119119}
120120```
121121
122+ ### .NET Core example
123+
124+ Add the following package references.
125+ ``` xml
126+ <PackageReference Include =" System.Data.SQLite" Version =" 1.0.112.2" />
127+ <PackageReference Include =" System.Data.SQLite.EF6" Version =" 1.0.112.2" />
128+ ```
129+
130+ Add the following class.
131+ ``` csharp
132+ public Configuration ()
133+ {
134+ SetProviderFactory (" System.Data.SQLite" , SQLiteFactory .Instance );
135+ SetProviderFactory (" System.Data.SQLite.EF6" , SQLiteProviderFactory .Instance );
136+
137+ var providerServices = (DbProviderServices )SQLiteProviderFactory .Instance .GetService (typeof (DbProviderServices ));
138+
139+ SetProviderServices (" System.Data.SQLite" , providerServices );
140+ SetProviderServices (" System.Data.SQLite.EF6" , providerServices );
141+
142+ SetDefaultConnectionFactory (this );
143+ }
144+
145+ public DbConnection CreateConnection (string connectionString )
146+ => new SQLiteConnection (connectionString );
147+ }
148+ ```
149+
122150## Structure
123151
124152The code is written in an extensible way.
You can’t perform that action at this time.
0 commit comments