Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / BasicKeyConstraint.cs / 1 / BasicKeyConstraint.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Mapping.ViewGeneration.Structures; using System.Collections.Generic; namespace System.Data.Mapping.ViewGeneration.Validation { using BasicSchemaConstraints = SchemaConstraints; // Class representing a key constraint on the basic cell relations internal class BasicKeyConstraint : KeyConstraint { #region Constructor // Constructs a key constraint for the given relation and keyslots internal BasicKeyConstraint(BasicCellRelation relation, IEnumerable keySlots) : base(relation, keySlots, JoinTreeSlot.SpecificEqualityComparer) { } #endregion #region Methods // effects: Propagates this constraint from the basic cell relation // to the corresponding view cell relation and returns the new constraint // If all the key slots are not being projected, returns null internal ViewKeyConstraint Propagate() { ViewCellRelation viewCellRelation = CellRelation.ViewCellRelation; // If all slots appear in the projection, propagate key constraint List viewSlots = new List (); foreach (JoinTreeSlot keySlot in KeySlots) { ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot); if (viewCellSlot == null) { // Slot is missing -- no key constraint on the view relation return null; } viewSlots.Add(viewCellSlot); } // Create a key on view relation ViewKeyConstraint viewKeyConstraint = new ViewKeyConstraint(viewCellRelation, viewSlots); return viewKeyConstraint; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Mapping.ViewGeneration.Structures; using System.Collections.Generic; namespace System.Data.Mapping.ViewGeneration.Validation { using BasicSchemaConstraints = SchemaConstraints; // Class representing a key constraint on the basic cell relations internal class BasicKeyConstraint : KeyConstraint { #region Constructor // Constructs a key constraint for the given relation and keyslots internal BasicKeyConstraint(BasicCellRelation relation, IEnumerable keySlots) : base(relation, keySlots, JoinTreeSlot.SpecificEqualityComparer) { } #endregion #region Methods // effects: Propagates this constraint from the basic cell relation // to the corresponding view cell relation and returns the new constraint // If all the key slots are not being projected, returns null internal ViewKeyConstraint Propagate() { ViewCellRelation viewCellRelation = CellRelation.ViewCellRelation; // If all slots appear in the projection, propagate key constraint List viewSlots = new List (); foreach (JoinTreeSlot keySlot in KeySlots) { ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot); if (viewCellSlot == null) { // Slot is missing -- no key constraint on the view relation return null; } viewSlots.Add(viewCellSlot); } // Create a key on view relation ViewKeyConstraint viewKeyConstraint = new ViewKeyConstraint(viewCellRelation, viewSlots); return viewKeyConstraint; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InstancePersistence.cs
- MenuCommands.cs
- EditableRegion.cs
- CommandHelper.cs
- ContainerUtilities.cs
- TransactionCache.cs
- FontFamilyIdentifier.cs
- ServiceCredentials.cs
- ListViewTableRow.cs
- Triplet.cs
- CodeDOMUtility.cs
- Label.cs
- ChineseLunisolarCalendar.cs
- CopyEncoder.cs
- HtmlTableRow.cs
- InvalidProgramException.cs
- LocalizableResourceBuilder.cs
- SQLInt16Storage.cs
- TextBox.cs
- ValueConversionAttribute.cs
- BlobPersonalizationState.cs
- SecurityKeyType.cs
- EntityWrapperFactory.cs
- Semaphore.cs
- SupportsEventValidationAttribute.cs
- HttpFileCollection.cs
- PtsHelper.cs
- MatrixTransform3D.cs
- ViewCellSlot.cs
- EntityDataSourceConfigureObjectContext.cs
- MsmqHostedTransportManager.cs
- SqlErrorCollection.cs
- NullableConverter.cs
- BitmapCodecInfoInternal.cs
- TdsParserHelperClasses.cs
- StickyNoteContentControl.cs
- KeyGestureValueSerializer.cs
- BitmapPalettes.cs
- DataGridToolTip.cs
- Argument.cs
- EncoderParameter.cs
- AssemblySettingAttributes.cs
- DispatcherHookEventArgs.cs
- CheckoutException.cs
- Zone.cs
- RoleGroupCollection.cs
- InfoCardPolicy.cs
- Fonts.cs
- precedingquery.cs
- SqlEnums.cs
- DataGridViewRowPostPaintEventArgs.cs
- ConfigurationSettings.cs
- InputScope.cs
- TargetPerspective.cs
- DuplicateContext.cs
- PersonalizationState.cs
- RegexStringValidatorAttribute.cs
- VectorKeyFrameCollection.cs
- RegexGroup.cs
- ExceptionRoutedEventArgs.cs
- ProgressBarAutomationPeer.cs
- HwndSource.cs
- DetailsViewPagerRow.cs
- TypedElement.cs
- ListItemsPage.cs
- TypedTableBase.cs
- GeometryCombineModeValidation.cs
- StrokeCollection2.cs
- SafeNativeMethods.cs
- IImplicitResourceProvider.cs
- HostingEnvironmentSection.cs
- SocketStream.cs
- LazyLoadBehavior.cs
- HttpListenerContext.cs
- DocumentXmlWriter.cs
- PassportAuthenticationEventArgs.cs
- IResourceProvider.cs
- PieceNameHelper.cs
- ServiceInstallComponent.cs
- Size.cs
- XmlSortKeyAccumulator.cs
- ComboBox.cs
- DummyDataSource.cs
- FunctionQuery.cs
- MD5.cs
- HtmlLink.cs
- SystemFonts.cs
- XmlSchemaComplexContentRestriction.cs
- MatchingStyle.cs
- shaperfactory.cs
- Authorization.cs
- DropShadowBitmapEffect.cs
- Rect3D.cs
- PropertyGeneratedEventArgs.cs
- ApplicationSettingsBase.cs
- DBDataPermissionAttribute.cs
- LateBoundChannelParameterCollection.cs
- AtomServiceDocumentSerializer.cs
- ConfigurationSectionHelper.cs
- ErrorEventArgs.cs