File tree 1 file changed +28
-0
lines changed
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
119
119
}
120
120
```
121
121
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
+
122
150
## Structure
123
151
124
152
The code is written in an extensible way.
You can’t perform that action at this time.
0 commit comments