@@ -23,71 +23,45 @@ namespace NHibernate.SqlTypes
2323 [ Serializable ]
2424 public class SqlType : IEquatable < SqlType >
2525 {
26- private readonly DbType dbType ;
27- private readonly int length ;
28- private readonly byte precision ;
29- private readonly byte scale ;
30- private readonly bool lengthDefined ;
31- private readonly bool precisionDefined ;
26+ private readonly int ? _length ;
27+ private readonly byte ? _precision ;
28+ private readonly byte ? _scale ;
3229
3330 public SqlType ( DbType dbType )
3431 {
35- this . dbType = dbType ;
32+ DbType = dbType ;
3633 }
3734
3835 public SqlType ( DbType dbType , int length )
3936 {
40- this . dbType = dbType ;
41- this . length = length ;
42- lengthDefined = true ;
37+ DbType = dbType ;
38+ _length = length ;
4339 }
4440
4541 public SqlType ( DbType dbType , byte precision , byte scale )
4642 {
47- this . dbType = dbType ;
48- this . precision = precision ;
49- this . scale = scale ;
50- precisionDefined = true ;
43+ DbType = dbType ;
44+ _precision = precision ;
45+ _scale = scale ;
5146 }
5247
5348 public SqlType ( DbType dbType , byte scale )
5449 {
55- this . dbType = dbType ;
56- this . scale = scale ;
57- ScaleDefined = true ;
50+ DbType = dbType ;
51+ _scale = scale ;
5852 }
5953
60- public DbType DbType
61- {
62- get { return dbType ; }
63- }
64-
65- public int Length
66- {
67- get { return length ; }
68- }
69-
70- public byte Precision
71- {
72- get { return precision ; }
73- }
54+ public DbType DbType { get ; }
7455
75- public byte Scale
76- {
77- get { return scale ; }
78- }
56+ public int Length => _length . GetValueOrDefault ( ) ;
57+ public byte Precision => _precision . GetValueOrDefault ( ) ;
58+ public byte Scale => _scale . GetValueOrDefault ( ) ;
59+ public bool LengthDefined => _length . HasValue ;
7960
80- public bool LengthDefined
81- {
82- get { return lengthDefined ; }
83- }
61+ public bool PrecisionDefined => _precision . HasValue ;
8462
85- public bool PrecisionDefined
86- {
87- get { return precisionDefined ; }
88- }
8963
90- public bool ScaleDefined { get ; }
64+ public bool ScaleDefined => _scale . HasValue ;
9165
9266 #region System.Object Members
9367
0 commit comments