@@ -50,7 +50,8 @@ public TypeInfo BuildType(TypeDef typeDef)
5050 MappingName = typeDef . MappingName ,
5151 MappingDatabase = typeDef . MappingDatabase ,
5252 MappingSchema = typeDef . MappingSchema ,
53- HasVersionRoots = TypeHelper . GetInterfacesUnordered ( typeDef . UnderlyingType ) . Any ( static type => type == typeof ( IHasVersionRoots ) ) ,
53+ HasVersionRoots = TypeHelper . GetInterfacesUnordered ( typeDef . UnderlyingType )
54+ . Any ( static type => type == typeof ( IHasVersionRoots ) ) ,
5455 Validators = validators ,
5556 } ;
5657
@@ -63,8 +64,8 @@ public TypeInfo BuildType(TypeDef typeDef)
6364 // Registering connections between type & its ancestors
6465 var node = context . DependencyGraph . TryGetNode ( typeDef ) ;
6566 if ( node != null ) {
66- foreach ( var edge in node . OutgoingEdges . Where ( e =>
67- e . Kind == EdgeKind . Implementation || e . Kind == EdgeKind . Inheritance ) ) {
67+ foreach ( var edge in node . OutgoingEdges . Where ( static e =>
68+ e . Kind is EdgeKind . Implementation or EdgeKind . Inheritance ) ) {
6869 var baseType = context . Model . Types [ edge . Head . Value . UnderlyingType ] ;
6970 switch ( edge . Kind ) {
7071 case EdgeKind . Inheritance :
@@ -92,7 +93,7 @@ public TypeInfo BuildType(TypeDef typeDef)
9293 else {
9394 var root = context . Model . Types [ hierarchyDef . Root . UnderlyingType ] ;
9495 typeInfo . Hierarchy = root . Hierarchy ;
95- foreach ( var fieldInfo in root . Fields . Where ( f => f . IsPrimaryKey && f . Parent == null ) ) {
96+ foreach ( var fieldInfo in root . Fields . Where ( static f => f . IsPrimaryKey && f . Parent == null ) ) {
9697 BuildInheritedField ( typeInfo , fieldInfo ) ;
9798 }
9899 }
@@ -112,7 +113,7 @@ public TypeInfo BuildType(TypeDef typeDef)
112113 public void BuildTypeDiscriminatorMap ( TypeDef typeDef , TypeInfo typeInfo )
113114 {
114115 if ( typeDef . TypeDiscriminatorValue != null ) {
115- var targetField = typeInfo . Fields . SingleOrDefault ( f => f . IsTypeDiscriminator && f . Parent == null ) ;
116+ var targetField = typeInfo . Fields . SingleOrDefault ( static f => f . IsTypeDiscriminator && f . Parent == null ) ;
116117 if ( targetField == null ) {
117118 throw new DomainBuilderException ( string . Format ( Strings . ExTypeDiscriminatorIsNotFoundForXType , typeInfo . Name ) ) ;
118119 }
@@ -136,8 +137,8 @@ public void BuildFields(TypeDef typeDef, TypeInfo typeInfo)
136137 {
137138 if ( typeInfo . IsInterface ) {
138139 var sourceFields = typeInfo . DirectInterfaces
139- . SelectMany ( i => i . Fields )
140- . Where ( f => ! f . IsPrimaryKey && f . Parent == null ) ;
140+ . SelectMany ( static i => i . Fields )
141+ . Where ( static f => ! f . IsPrimaryKey && f . Parent == null ) ;
141142 foreach ( var srcField in sourceFields ) {
142143 if ( ! typeInfo . Fields . Contains ( srcField . Name ) ) {
143144 BuildInheritedField ( typeInfo , srcField ) ;
@@ -147,7 +148,7 @@ public void BuildFields(TypeDef typeDef, TypeInfo typeInfo)
147148 else {
148149 var ancestor = typeInfo . Ancestor ;
149150 if ( ancestor != null ) {
150- foreach ( var srcField in ancestor . Fields . Where ( f => ! f . IsPrimaryKey && f . Parent == null ) ) {
151+ foreach ( var srcField in ancestor . Fields . Where ( static f => ! f . IsPrimaryKey && f . Parent == null ) ) {
151152 if ( typeDef . Fields . TryGetValue ( srcField . Name , out var fieldDef ) ) {
152153 if ( fieldDef . UnderlyingProperty == null ) {
153154 throw new DomainBuilderException (
@@ -184,7 +185,7 @@ public void BuildFields(TypeDef typeDef, TypeInfo typeInfo)
184185 _ = BuildDeclaredField ( typeInfo , fieldDef ) ;
185186 }
186187 }
187- typeInfo . Columns . AddRange ( typeInfo . Fields . Where ( f => f . Column != null ) . Select ( f => f . Column ) ) ;
188+ typeInfo . Columns . AddRange ( typeInfo . Fields . Where ( static f => f . Column != null ) . Select ( static f => f . Column ) ) ;
188189
189190 if ( typeInfo . IsEntity && ! IsAuxiliaryType ( typeInfo ) ) {
190191 foreach ( var @interface in typeInfo . DirectInterfaces ) {
@@ -197,7 +198,7 @@ public void BuildFields(TypeDef typeDef, TypeInfo typeInfo)
197198
198199 private void BuildFieldMap ( TypeInfo @interface , TypeInfo implementor )
199200 {
200- foreach ( var field in @interface . Fields . Where ( f => f . IsDeclared ) ) {
201+ foreach ( var field in @interface . Fields . Where ( static f => f . IsDeclared ) ) {
201202 var explicitName = context . NameBuilder . BuildExplicitFieldName ( field . DeclaringType , field . Name ) ;
202203 if ( implementor . Fields . TryGetValue ( explicitName , out var implField ) ) {
203204 implField . IsExplicit = true ;
@@ -262,7 +263,7 @@ private FieldInfo BuildDeclaredField(TypeInfo type, FieldDef fieldDef)
262263 }
263264
264265 if ( fieldInfo . IsEntity ) {
265- var fields = context . Model . Types [ fieldInfo . ValueType ] . Fields . Where ( f => f . IsPrimaryKey ) ;
266+ var fields = context . Model . Types [ fieldInfo . ValueType ] . Fields . Where ( static f => f . IsPrimaryKey ) ;
266267 // Adjusting default value if any
267268 if ( fields . Count ( ) == 1 && fieldDef . DefaultValue != null ) {
268269 fieldInfo . DefaultValue =
@@ -304,7 +305,7 @@ .StructureFieldMapping[new Pair<FieldInfo>(fieldInfo, structureTypeInfo.Fields[f
304305 f . Configuration ,
305306 f . TypeFieldName
306307 ) )
307- . Select ( g => new FullTextFieldDef ( g . Name , g . IsAnalyzed ) {
308+ . Select ( static g => new FullTextFieldDef ( g . Name , g . IsAnalyzed ) {
308309 Configuration = g . Configuration , TypeFieldName = g . TypeFieldName
309310 } ) ) ;
310311 }
@@ -471,7 +472,7 @@ private HierarchyInfo BuildHierarchyInfo(TypeInfo root, HierarchyDef hierarchyDe
471472 if ( schema != InheritanceSchema . ConcreteTable ) {
472473 var node = context . DependencyGraph . TryGetNode ( hierarchyDef . Root ) ;
473474 // No dependencies => no descendants
474- if ( node == null || node . IncomingEdges . Count ( e => e . Kind == EdgeKind . Inheritance ) == 0 ) {
475+ if ( node == null || node . IncomingEdges . Count ( static e => e . Kind == EdgeKind . Inheritance ) == 0 ) {
475476 schema = InheritanceSchema . ConcreteTable ;
476477 }
477478 }
@@ -490,17 +491,17 @@ private HierarchyInfo BuildHierarchyInfo(TypeInfo root, HierarchyDef hierarchyDe
490491 private KeyInfo BuildKeyInfo ( TypeInfo root , HierarchyDef hierarchyDef )
491492 {
492493 var keyFields = root . Fields
493- . Where ( field => field . IsPrimaryKey )
494- . OrderBy ( field => field . MappingInfo . Offset )
494+ . Where ( static field => field . IsPrimaryKey )
495+ . OrderBy ( static field => field . MappingInfo . Offset )
495496 . ToList ( ) ;
496497
497498 var keyColumns = keyFields
498- . Where ( field => field . Column != null )
499- . Select ( field => field . Column )
499+ . Where ( static field => field . Column != null )
500+ . Select ( static field => field . Column )
500501 . ToList ( ) ;
501502
502503 var keyTupleDescriptor = TupleDescriptor . Create (
503- keyColumns . Select ( c => c . ValueType ) . ToArray ( keyColumns . Count ) ) ;
504+ keyColumns . Select ( static c => c . ValueType ) . ToArray ( keyColumns . Count ) ) ;
504505 var typeIdColumnIndex = - 1 ;
505506 if ( hierarchyDef . IncludeTypeId ) {
506507 for ( var i = 0 ; i < keyColumns . Count ; i ++ ) {
0 commit comments