|
1 |
| -using FluentNHibernate.Driver; |
2 |
| -using NHibernate.Dialect; |
| 1 | +using FluentNHibernate.Dialects; |
| 2 | +using FluentNHibernate.Driver; |
3 | 3 |
|
4 | 4 | namespace FluentNHibernate.Cfg.Db;
|
5 | 5 |
|
6 | 6 | public class MsSqliteConfiguration : PersistenceConfiguration<MsSqliteConfiguration>
|
7 | 7 | {
|
8 |
| - public static MsSqliteConfiguration Standard |
9 |
| - { |
10 |
| - get { return new MsSqliteConfiguration(); } |
11 |
| - } |
| 8 | + public static MsSqliteConfiguration Standard => new(); |
12 | 9 |
|
13 | 10 | public MsSqliteConfiguration()
|
14 | 11 | {
|
15 | 12 | Driver<MsSQLiteDriver>();
|
16 |
| - Dialect<SQLiteDialect>(); |
| 13 | + Dialect<MsSQLiteDialect>(); |
17 | 14 | Raw("query.substitutions", "true=1;false=0");
|
18 | 15 | }
|
19 | 16 |
|
20 |
| - public MsSqliteConfiguration InMemory() |
21 |
| - { |
22 |
| - Raw("connection.release_mode", "on_close"); |
| 17 | + public MsSqliteConfiguration InMemory() => |
| 18 | + ConnectionString(c => c.Is("Data Source=:memory:")) |
| 19 | + .Raw("connection.release_mode", "on_close"); |
23 | 20 |
|
24 |
| - return ConnectionString(c => c |
25 |
| - .Is("Data Source=:memory:")); |
26 |
| - } |
27 |
| - |
28 |
| - public MsSqliteConfiguration UsingFile(string fileName) |
29 |
| - { |
30 |
| - return ConnectionString(c => c |
31 |
| - .Is(string.Format("Data Source={0}", fileName))); |
32 |
| - } |
| 21 | + public MsSqliteConfiguration UsingFile(string fileName) => |
| 22 | + ConnectionString(c => c.Is($"Data Source={fileName}")); |
33 | 23 | }
|
0 commit comments