@@ -15,10 +15,10 @@ namespace NHibernate.Type
15
15
[ Serializable ]
16
16
public partial class ByteType : PrimitiveType , IDiscriminatorType , IVersionType
17
17
{
18
- private static readonly byte ZERO = 0 ;
18
+ private static readonly object ZeroObject = ( byte ) 0 ;
19
19
20
- public ByteType ( )
21
- : base ( SqlTypeFactory . Byte )
20
+ /// <summary />
21
+ public ByteType ( ) : base ( SqlTypeFactory . Byte )
22
22
{
23
23
}
24
24
@@ -32,26 +32,17 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
32
32
} ;
33
33
}
34
34
35
- public override System . Type ReturnedClass
36
- {
37
- get { return typeof ( byte ) ; }
38
- }
35
+ public override System . Type ReturnedClass => typeof ( byte ) ;
39
36
40
- public override System . Type PrimitiveClass
41
- {
42
- get { return typeof ( byte ) ; }
43
- }
37
+ public override System . Type PrimitiveClass => typeof ( byte ) ;
44
38
45
39
public override void Set ( DbCommand cmd , object value , int index , ISessionImplementor session )
46
40
{
47
41
var dp = cmd . Parameters [ index ] ;
48
42
dp . Value = dp . DbType == DbType . Int16 ? Convert . ToInt16 ( value ) : Convert . ToByte ( value ) ;
49
43
}
50
44
51
- public override string Name
52
- {
53
- get { return "Byte" ; }
54
- }
45
+ public override string Name => "Byte" ;
55
46
56
47
public override string ObjectToSQLString ( object value , Dialect . Dialect dialect )
57
48
{
@@ -84,17 +75,11 @@ public virtual object Next(object current, ISessionImplementor session)
84
75
85
76
public virtual object Seed ( ISessionImplementor session )
86
77
{
87
- return ZERO ;
78
+ return ZeroObject ;
88
79
}
89
80
90
- public IComparer Comparator
91
- {
92
- get { return Comparer . DefaultInvariant ; }
93
- }
81
+ public IComparer Comparator => Comparer . DefaultInvariant ;
94
82
95
- public override object DefaultValue
96
- {
97
- get { return ZERO ; }
98
- }
83
+ public override object DefaultValue => ZeroObject ;
99
84
}
100
85
}
0 commit comments