File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed
Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -807,15 +807,15 @@ private ColumnGroup BuildColumnGroup(IndexInfo index)
807807 {
808808 var reflectedType = index . ReflectedType ;
809809 var keyColumns = index . IsPrimary
810- ? Enumerable . Range ( 0 , index . KeyColumns . Count ) . ToList ( )
810+ ? Enumerable . Range ( 0 , index . KeyColumns . Count ) . ToList ( index . KeyColumns . Count )
811811 : index . KeyColumns
812812 . Select ( pair => pair . Key )
813813 . Concat ( index . ValueColumns )
814814 . Select ( ( c , i ) => ( c , i ) )
815815 . Where ( arg => arg . c . IsPrimaryKey )
816816 . Select ( arg => arg . i )
817817 . ToList ( ) ;
818- var columns = Enumerable . Range ( 0 , index . KeyColumns . Count + index . ValueColumns . Count ) . ToList ( ) ;
818+ var columns = Enumerable . Range ( 0 , index . KeyColumns . Count + index . ValueColumns . Count ) . ToList ( index . KeyColumns . Count + index . ValueColumns . Count ) ;
819819 return new ColumnGroup ( reflectedType , keyColumns , columns ) ;
820820 }
821821
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ internal BuildingContext(DomainBuilderConfiguration builderConfiguration)
8585 ModelInspectionResult = new ModelInspectionResult ( ) ;
8686 DependencyGraph = new Graph < TypeDef > ( ) ;
8787
88- Modules = BuilderConfiguration . Services . Modules . ToList ( ) . AsReadOnly ( ) ;
88+
89+ Modules = BuilderConfiguration . Services . Modules . ToList ( BuilderConfiguration . Services . Modules . Count ) . AsReadOnly ( ) ;
8990 Modules2 = Modules . OfType < IModule2 > ( ) . ToList ( ) . AsReadOnly ( ) ;
9091 Validator = new Validator ( builderConfiguration . Services . ProviderInfo . SupportedTypes ) ;
9192 DefaultSchemaInfo = builderConfiguration . DefaultSchemaInfo ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public override void UpdateState()
4545 {
4646 base . UpdateState ( ) ;
4747 Key . UpdateState ( ) ;
48- var list = new List < TypeInfo > { Root } ;
48+ var list = new List < TypeInfo > ( Root . AllDescendants . Count + 1 ) { Root } ;
4949 list . AddRange ( Root . AllDescendants ) ;
5050 Types = list . AsReadOnly ( ) ;
5151 if ( Types . Count == 1 )
Original file line number Diff line number Diff line change 1- // Copyright (C) 2011 Xtensive LLC.
1+ // Copyright (C) 2011 Xtensive LLC.
22// All rights reserved.
33// For conditions of distribution and use, see license.
44// Created by: Denis Krjuchkov
@@ -56,7 +56,9 @@ public override void Lock(bool recursive)
5656 throw Exceptions . NotInitialized ( "Expression" ) ;
5757 if ( Fields == null )
5858 throw Exceptions . NotInitialized ( "Fields" ) ;
59- fields = fields . ToList ( ) . AsReadOnly ( ) ;
59+ fields = fields is List < FieldInfo > list
60+ ? list . AsReadOnly ( )
61+ : ( IList < FieldInfo > ) fields . ToList ( ) . AsReadOnly ( ) ;
6062 base . Lock ( recursive ) ;
6163 }
6264 }
You can’t perform that action at this time.
0 commit comments