66using System . Linq ;
77using System . Reflection ;
88
9+ using LinqTableAttribute = System . Data . Linq . Mapping . TableAttribute ;
10+
911namespace DataBoss . Specs
1012{
1113 class DataBossMappingSource : MappingSource
@@ -20,11 +22,11 @@ public DataBossTable(MetaModel model, Type rowType) {
2022 this . rowType = rowType ;
2123 }
2224
23- public override MetaModel Model { get { return model ; } }
25+ public override MetaModel Model => model ;
2426
2527 public override string TableName {
2628 get {
27- var linqTable = rowType . GetCustomAttributes ( typeof ( System . Data . Linq . Mapping . TableAttribute ) , true ) . Cast < System . Data . Linq . Mapping . TableAttribute > ( ) . SingleOrDefault ( ) ;
29+ var linqTable = rowType . GetCustomAttributes ( typeof ( LinqTableAttribute ) , true ) . Cast < LinqTableAttribute > ( ) . SingleOrDefault ( ) ;
2830 if ( linqTable != null )
2931 return linqTable . Name ;
3032 var table = rowType . GetCustomAttributes ( typeof ( System . ComponentModel . DataAnnotations . Schema . TableAttribute ) , true ) . Cast < System . ComponentModel . DataAnnotations . Schema . TableAttribute > ( ) . Single ( ) ;
@@ -73,25 +75,25 @@ public DataBossRowType(MetaTable table, Type type) {
7375 }
7476 }
7577
76- public override MetaTable Table { get { return table ; } }
78+ public override MetaTable Table => table ;
7779
78- public override Type Type { get { return type ; } }
80+ public override Type Type => type ;
7981
80- public override ReadOnlyCollection < MetaAssociation > Associations { get { return NoAssociations ; } }
82+ public override ReadOnlyCollection < MetaAssociation > Associations => NoAssociations ;
8183
82- public override ReadOnlyCollection < MetaDataMember > PersistentDataMembers { get { return members . AsReadOnly ( ) ; } }
84+ public override ReadOnlyCollection < MetaDataMember > PersistentDataMembers => members . AsReadOnly ( ) ;
8385
84- public override MetaType InheritanceRoot { get { return null ; } }
86+ public override MetaType InheritanceRoot => null ;
8587
8688 public override MetaType GetInheritanceType ( Type type ) {
8789 if ( type == this . type )
8890 return this ;
8991 throw new NotSupportedException ( "Can't locate inheritance type for " + type . FullName ) ;
9092 }
9193
92- public override bool IsEntity { get { return false ; } }
94+ public override bool IsEntity => false ;
9395
94- public override ReadOnlyCollection < MetaDataMember > IdentityMembers { get { return NoMembers ; } }
96+ public override ReadOnlyCollection < MetaDataMember > IdentityMembers => NoMembers ;
9597
9698 public override bool CanInstantiate {
9799 get { throw new NotImplementedException ( ) ; }
@@ -132,7 +134,7 @@ public override bool HasAnyValidateMethod {
132134 get { throw new NotImplementedException ( ) ; }
133135 }
134136
135- public override bool HasInheritance { get { return false ; } }
137+ public override bool HasInheritance => false ;
136138
137139 public override bool HasInheritanceCode {
138140 get { throw new NotImplementedException ( ) ; }
@@ -197,19 +199,19 @@ public DataBossDataMember(MetaType declaringType, MemberInfo member, Type member
197199 this . name = name ;
198200 }
199201
200- public override string MappedName { get { return name ; } }
202+ public override string MappedName => name ;
201203
202- public override MemberInfo Member { get { return member ; } }
204+ public override MemberInfo Member => member ;
203205
204- public override bool IsAssociation { get { return false ; } }
206+ public override bool IsAssociation => false ;
205207
206- public override bool IsDeferred { get { return false ; } }
208+ public override bool IsDeferred => false ;
207209
208- public override Type Type { get { return memberType ; } }
210+ public override Type Type => memberType ;
209211
210- public override string DbType { get { return DataBossScripter . ToDbType ( memberType , member ) ; } }
212+ public override string DbType => DataBossScripter . ToDbType ( memberType , member ) ;
211213
212- public override MetaType DeclaringType { get { return declaringType ; } }
214+ public override MetaType DeclaringType => declaringType ;
213215
214216 public override MetaAssociation Association {
215217 get { throw new NotImplementedException ( ) ; }
@@ -297,9 +299,9 @@ public DataBossMetaModel(Type contextType) {
297299 this . contextType = contextType ;
298300 }
299301
300- public override Type ContextType { get { return contextType ; } }
302+ public override Type ContextType => contextType ;
301303
302- public override Type ProviderType { get { return typeof ( Sql2005Provider ) ; } }
304+ public override Type ProviderType => typeof ( Sql2005Provider ) ;
303305
304306 public override MetaTable GetTable ( Type rowType ) {
305307 MetaTable cached ;
0 commit comments