1- // Copyright (C) 2003-2010 Xtensive LLC.
2- // All rights reserved .
3- // For conditions of distribution and use, see license .
1+ // Copyright (C) 2009-2023 Xtensive LLC.
2+ // This code is distributed under MIT license terms .
3+ // See the License.txt file in the project root for more information .
44// Created by: Ivan Galkin
55// Created: 2009.03.20
66
77using System ;
88using System . Linq ;
9- using Xtensive . Core ;
109using Xtensive . Modelling ;
1110using Xtensive . Modelling . Attributes ;
1211
@@ -31,7 +30,7 @@ public sealed class PrimaryIndexInfo : IndexInfo
3130 /// </summary>
3231 public void PopulateValueColumns ( )
3332 {
34- var keySet = EnumerableExtensions . ToHashSet ( KeyColumns . Select ( kc => kc . Value ) ) ;
33+ var keySet = KeyColumns . Select ( kc => kc . Value ) . ToHashSet ( ) ;
3534
3635 foreach ( var column in Parent . Columns . Where ( c => ! keySet . Contains ( c ) ) )
3736 new ValueColumnRef ( this , column ) ;
@@ -41,7 +40,7 @@ public void PopulateValueColumns()
4140 /// <exception cref="ValidationException">Validation error.</exception>
4241 protected override void ValidateState ( )
4342 {
44- using ( var ea = new ExceptionAggregator ( ) ) {
43+ using ( var ea = new Xtensive . Core . ExceptionAggregator ( ) ) {
4544 ea . Execute ( base . ValidateState ) ;
4645 base . ValidateState ( ) ;
4746
@@ -63,7 +62,7 @@ protected override void ValidateState()
6362 ea . Execute ( ( ) => {
6463 throw new ValidationException ( Strings . ExInvalidPrimaryKeyStructure , Path ) ;
6564 } ) ;
66- if ( all . Zip ( tableColumns ) . Where ( p => p . First != p . Second ) . Any ( ) )
65+ if ( all . Zip ( tableColumns , ( first , second ) => new { First = first , Second = second } ) . Where ( p => p . First != p . Second ) . Any ( ) )
6766 ea . Execute ( ( ) => {
6867 throw new ValidationException ( Strings . ExInvalidPrimaryKeyStructure , Path ) ;
6968 } ) ;
0 commit comments