File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
NHibernate.TestDatabaseSetup Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 55
55
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
56
56
</Content >
57
57
</ItemGroup >
58
+ <ItemGroup Condition =" '$(NuGetPackageRoot)' != '' " >
59
+ <NativeBinaries Include =" $(NuGetPackageRoot)system.data.sqlite.core\1.0.105.2\build\net46\**\*.*" />
60
+ <Content Include =" @(NativeBinaries)" >
61
+ <Link >%(RecursiveDir)%(Filename)%(Extension)</Link >
62
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
63
+ </Content >
64
+ </ItemGroup >
58
65
<ItemGroup >
59
66
<ProjectReference Include =" ..\NHibernate.DomainModel\NHibernate.DomainModel.csproj" />
60
67
<ProjectReference Include =" ..\NHibernate\NHibernate.csproj" />
Original file line number Diff line number Diff line change 3
3
using System . Data . Odbc ;
4
4
using System . Data . SqlClient ;
5
5
using System . Data . SqlServerCe ;
6
+ using System . Data . SQLite ;
6
7
using System . IO ;
7
8
using FirebirdSql . Data . FirebirdClient ;
8
9
using NHibernate . Test ;
@@ -182,8 +183,19 @@ RETURNS uuid
182
183
183
184
private static void SetupSQLite ( Cfg . Configuration cfg )
184
185
{
185
- if ( File . Exists ( "NHibernate.db" ) )
186
- File . Delete ( "NHibernate.db" ) ;
186
+ var connStr = cfg . Properties [ Cfg . Environment . ConnectionString ] ;
187
+
188
+ try
189
+ {
190
+ var connStrBuilder = new SQLiteConnectionStringBuilder ( connStr ) ;
191
+ var dataSource = connStrBuilder . DataSource ;
192
+ if ( File . Exists ( dataSource ) )
193
+ File . Delete ( dataSource ) ;
194
+ }
195
+ catch ( Exception e )
196
+ {
197
+ Console . WriteLine ( e ) ;
198
+ }
187
199
}
188
200
189
201
private static void SetupOracle ( Cfg . Configuration cfg )
You can’t perform that action at this time.
0 commit comments