Skip to content

Commit c5f7c20

Browse files
committed
Changes according to comments
1 parent e4d0193 commit c5f7c20

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

SQLite.CodeFirst/SqliteInitializerBase.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Data.Entity;
33
using System.Data.Entity.ModelConfiguration.Conventions;
44
using SQLite.CodeFirst.Convention;
5+
using System.IO;
56

67
namespace SQLite.CodeFirst
78
{
@@ -60,15 +61,10 @@ public virtual void InitializeDatabase(TContext context)
6061
{
6162
var model = modelBuilder.Build(context.Database.Connection);
6263

63-
//mprattinger: Possible fix for #45
6464
var dbFile = GetDatabasePathFromContext(context);
65-
var dbFileInfo = new System.IO.FileInfo(dbFile);
66-
if (!dbFileInfo.Directory.Exists)
67-
{
68-
//DBPath doesn't exist -> create it:
69-
dbFileInfo.Directory.Create();
70-
}
71-
//mprattinger
65+
var dbFileInfo = new FileInfo(dbFile);
66+
dbFileInfo.Directory.Create();
67+
7268

7369
using (var transaction = context.Database.BeginTransaction())
7470
{

0 commit comments

Comments
 (0)