@@ -15,10 +15,10 @@ namespace NHibernate.Type
1515 [ Serializable ]
1616 public partial class ByteType : PrimitiveType , IDiscriminatorType , IVersionType
1717 {
18- private static readonly byte ZERO = 0 ;
18+ private static readonly object ZeroObject = ( byte ) 0 ;
1919
20- public ByteType ( )
21- : base ( SqlTypeFactory . Byte )
20+ /// <summary />
21+ public ByteType ( ) : base ( SqlTypeFactory . Byte )
2222 {
2323 }
2424
@@ -32,26 +32,17 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
3232 } ;
3333 }
3434
35- public override System . Type ReturnedClass
36- {
37- get { return typeof ( byte ) ; }
38- }
35+ public override System . Type ReturnedClass => typeof ( byte ) ;
3936
40- public override System . Type PrimitiveClass
41- {
42- get { return typeof ( byte ) ; }
43- }
37+ public override System . Type PrimitiveClass => typeof ( byte ) ;
4438
4539 public override void Set ( DbCommand cmd , object value , int index , ISessionImplementor session )
4640 {
4741 var dp = cmd . Parameters [ index ] ;
4842 dp . Value = dp . DbType == DbType . Int16 ? Convert . ToInt16 ( value ) : Convert . ToByte ( value ) ;
4943 }
5044
51- public override string Name
52- {
53- get { return "Byte" ; }
54- }
45+ public override string Name => "Byte" ;
5546
5647 public override string ObjectToSQLString ( object value , Dialect . Dialect dialect )
5748 {
@@ -84,17 +75,11 @@ public virtual object Next(object current, ISessionImplementor session)
8475
8576 public virtual object Seed ( ISessionImplementor session )
8677 {
87- return ZERO ;
78+ return ZeroObject ;
8879 }
8980
90- public IComparer Comparator
91- {
92- get { return Comparer . DefaultInvariant ; }
93- }
81+ public IComparer Comparator => Comparer . DefaultInvariant ;
9482
95- public override object DefaultValue
96- {
97- get { return ZERO ; }
98- }
83+ public override object DefaultValue => ZeroObject ;
9984 }
10085}
0 commit comments