You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
Creates a [SQLite Database](https://sqlite.org/) from Code, using [Entity Framework](https://msdn.microsoft.com/en-us/data/ef.aspx) CodeFirst.
7
7
8
-
This Project ships several `IDbInitializer`which creates a new SQLite Database, based on your model/code.
8
+
This Project ships several `IDbInitializer`classes. These create new SQLite Databases based on your model/code.
9
9
I started with the [code](https://gist.github.com/flaub/1968486e1b3f2b9fddaf) from [flaub](https://github.com/flaub).
10
10
11
11
Currently the following is supported:
@@ -18,23 +18,23 @@ Currently the following is supported:
18
18
- Index (Decorate columns with the `Index` attribute. Indices are automatically created for foreign keys by default. To prevent this you can remove the convetion `ForeignKeyIndexConvention`)
19
19
20
20
I tried to write the code in a extensible way.
21
-
The logic is divided into two main parts. Builder and Statement.
21
+
The logic is divided into two main parts, Builder and Statement.
22
22
The Builder knows how to translate the EdmModel into statements where a statement class creates the SQLite-DDL-Code.
23
23
The structure of the statements is influenced by the [SQLite Language Specification](https://www.sqlite.org/lang.html).
24
24
You will find an extensive usage of the composite pattern.
25
25
26
26
## Install
27
27
Either get the assembly from the latest [GitHub Release Page](https://github.com/msallin/SQLiteCodeFirst/releases) or install the NuGet-Package [SQLite.CodeFirst](https://www.nuget.org/packages/SQLite.CodeFirst/) (`PM> Install-Package SQLite.CodeFirst`).
28
28
29
-
The project is builded for the target frameworks 4.0 and 4.5.
30
-
That means you can use the SQLite CodeFirst in projects with the following target frameworks.
29
+
The project is built to target.NET framework versions 4.0 and 4.5.
30
+
You can use the SQLite CodeFirst in projects that target the following frameworks:
31
31
- .NET 4.0 (use net40)
32
32
- .NET 4.5 (use net45)
33
33
- .NET 4.5.1 (use net45)
34
34
- .NET 4.5.2 (use net45)
35
35
36
36
## How to use
37
-
If you want to let the Entity Framework create the database, if it does not exist, just set `SqliteDropCreateDatabaseAlways<>` or `SqliteCreateDatabaseIfNotExists<>` as your `IDbInitializer<>`.
37
+
When you want to let the Entity Framework create database if it does not exist, just set `SqliteDropCreateDatabaseAlways<>` or `SqliteCreateDatabaseIfNotExists<>` as your `IDbInitializer<>`.
38
38
```csharp
39
39
publicclassMyDbContext : DbContext
40
40
{
@@ -50,9 +50,9 @@ public class MyDbContext : DbContext
50
50
}
51
51
```
52
52
53
-
In a more advanced scenario you may want to populate some core- or test-data after the database was created.
53
+
In a more advanced scenario, you may want to populate some core- or test-data after the database was created.
54
54
To do this, inherit from `SqliteDropCreateDatabaseAlways<>` or `SqliteCreateDatabaseIfNotExists<>` and override the `Seed(MyDbContext context)` function.
55
-
This function will be called, in a own transaction, right after the database was created. This function is only executed if a new database was successfully created.
55
+
This function will be called in a transaction once the database was created. This function is only executed if a new database was successfully created.
@@ -67,5 +67,5 @@ public class MyDbContextContextInitializer : SqliteDropCreateDatabaseAlways<MyDb
67
67
```
68
68
69
69
## Hints
70
-
If you try to reinstall the NuGet-Packages (e.g. if you want to downgrade to .NET 4.0) the app.config will be overwritten and you may getting an exception when you try to run the console project.
70
+
If you try to reinstall the NuGet-Packages (e.g. if you want to downgrade to .NET 4.0), the app.config will be overwritten and you may getting an exception when you try to run the console project.
71
71
In this case please check the following issue: https://github.com/msallin/SQLiteCodeFirst/issues/13.
0 commit comments