1
1
using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Text ;
5
2
using NHibernate . SqlTypes ;
6
3
7
4
namespace NHibernate . Test
@@ -15,56 +12,52 @@ public class TestDialect
15
12
{
16
13
public static TestDialect GetTestDialect ( Dialect . Dialect dialect )
17
14
{
18
- string testDialectTypeName = "NHibernate.Test.TestDialects." + dialect . GetType ( ) . Name . Replace ( "Dialect" , "TestDialect" ) ;
19
- System . Type testDialectType = System . Type . GetType ( testDialectTypeName ) ;
15
+ var testDialectTypeName = "NHibernate.Test.TestDialects." + dialect . GetType ( ) . Name . Replace ( "Dialect" , "TestDialect" ) ;
16
+ var testDialectType = System . Type . GetType ( testDialectTypeName ) ;
20
17
if ( testDialectType != null )
21
- return ( TestDialect ) Activator . CreateInstance ( testDialectType , dialect ) ;
18
+ return ( TestDialect ) Activator . CreateInstance ( testDialectType , dialect ) ;
22
19
return new TestDialect ( dialect ) ;
23
20
}
24
21
25
- private Dialect . Dialect dialect ;
22
+ readonly Dialect . Dialect _dialect ;
26
23
27
- public TestDialect ( Dialect . Dialect dialect )
28
- {
29
- this . dialect = dialect ;
30
- }
24
+ public TestDialect ( Dialect . Dialect dialect )
25
+ {
26
+ _dialect = dialect ;
27
+ }
31
28
32
- public virtual bool SupportsOperatorAll { get { return true ; } }
33
- public virtual bool SupportsOperatorSome { get { return true ; } }
34
- public virtual bool SupportsLocate { get { return true ; } }
29
+ public virtual bool SupportsOperatorAll => true ;
30
+ public virtual bool SupportsOperatorSome => true ;
31
+ public virtual bool SupportsLocate => true ;
35
32
36
- public virtual bool SupportsDistributedTransactions { get { return true ; } }
33
+ public virtual bool SupportsDistributedTransactions => true ;
37
34
38
35
/// <summary>
39
36
/// Whether two transactions can be run at the same time. For example, with SQLite
40
37
/// the database is locked when one transaction is run, so running a second transaction
41
38
/// will cause a "database is locked" error message.
42
39
/// </summary>
43
- public virtual bool SupportsConcurrentTransactions { get { return true ; } }
44
-
45
- public virtual bool SupportsFullJoin { get { return true ; } }
40
+ public virtual bool SupportsConcurrentTransactions => true ;
46
41
47
- public virtual bool HasBrokenDecimalType { get { return false ; } }
42
+ public virtual bool HasBrokenDecimalType => false ;
48
43
49
- public virtual bool SupportsNullCharactersInUtfStrings { get { return true ; } }
44
+ public virtual bool SupportsNullCharactersInUtfStrings => true ;
50
45
51
- public virtual bool SupportsSelectForUpdateOnOuterJoin { get { return true ; } }
46
+ public virtual bool SupportsSelectForUpdateOnOuterJoin => true ;
52
47
53
- public virtual bool SupportsHavingWithoutGroupBy { get { return true ; } }
48
+ public virtual bool SupportsHavingWithoutGroupBy => true ;
54
49
55
- public virtual bool IgnoresTrailingWhitespace { get { return false ; } }
56
-
57
- public bool SupportsSqlType ( SqlType sqlType )
58
- {
59
- try
60
- {
61
- dialect . GetTypeName ( sqlType ) ;
62
- return true ;
63
- }
64
- catch
65
- {
66
- return false ;
67
- }
68
- }
50
+ public bool SupportsSqlType ( SqlType sqlType )
51
+ {
52
+ try
53
+ {
54
+ _dialect . GetTypeName ( sqlType ) ;
55
+ return true ;
56
+ }
57
+ catch
58
+ {
59
+ return false ;
60
+ }
61
+ }
69
62
}
70
63
}
0 commit comments