Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- MessageTransmitTraceRecord.cs
- RightsManagementPermission.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DataSvcMapFileSerializer.cs
- MetadataException.cs
- SQLCharsStorage.cs
- PropertyTabAttribute.cs
- PropertyMapper.cs
- PagesChangedEventArgs.cs
- ColorBlend.cs
- ConfigurationSection.cs
- EasingKeyFrames.cs
- HandleRef.cs
- ServiceObjectContainer.cs
- FrameworkTextComposition.cs
- WebPartDesigner.cs
- BindingWorker.cs
- BooleanKeyFrameCollection.cs
- Point3DAnimationBase.cs
- ProfileProvider.cs
- DataProviderNameConverter.cs
- MetadataArtifactLoaderResource.cs
- Int32AnimationUsingKeyFrames.cs
- HScrollProperties.cs
- GenericArgumentsUpdater.cs
- ProcessThread.cs
- PrinterSettings.cs
- FlowPosition.cs
- DispatchOperation.cs
- Int64AnimationUsingKeyFrames.cs
- BitmapDecoder.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ArcSegment.cs
- InputMethodStateChangeEventArgs.cs
- RepeatBehaviorConverter.cs
- ExpressionNormalizer.cs
- CommentEmitter.cs
- MetadataSerializer.cs
- DodSequenceMerge.cs
- URLIdentityPermission.cs
- XpsSerializerWriter.cs
- SqlFacetAttribute.cs
- EntityKey.cs
- RuntimeWrappedException.cs
- EventNotify.cs
- BaseCAMarshaler.cs
- JavaScriptSerializer.cs
- CustomPopupPlacement.cs
- CodeCommentStatement.cs
- GroupBox.cs
- ColumnHeaderCollectionEditor.cs
- AccessText.cs
- StyleBamlRecordReader.cs
- HtmlWindowCollection.cs
- DataControlField.cs
- JournalEntryListConverter.cs
- SystemIPv6InterfaceProperties.cs
- SoapSchemaExporter.cs
- ConnectionPointCookie.cs
- MergeFailedEvent.cs
- CryptoKeySecurity.cs
- InfoCardHelper.cs
- ConfigurationManagerInternalFactory.cs
- storepermission.cs
- AuthenticationModuleElementCollection.cs
- RemoteWebConfigurationHostStream.cs
- HttpDictionary.cs
- WebPartTransformerCollection.cs
- Util.cs
- AnchoredBlock.cs
- externdll.cs
- Simplifier.cs
- CornerRadiusConverter.cs
- RoleGroupCollectionEditor.cs
- DataBinding.cs
- RecipientIdentity.cs
- TemplateField.cs
- FtpCachePolicyElement.cs
- FormCollection.cs
- AddInControllerImpl.cs
- SqlDataSourceCommandEventArgs.cs
- HttpStreamXmlDictionaryReader.cs
- WebBrowserNavigatingEventHandler.cs
- EntityDataSourceConfigureObjectContext.cs
- CFGGrammar.cs
- Context.cs
- ResourceReferenceExpression.cs
- BitmapEffectInputData.cs
- SecurityHeaderLayout.cs
- XmlSchemaSimpleContentRestriction.cs
- _SslStream.cs
- MailAddress.cs
- MergePropertyDescriptor.cs
- NativeMethods.cs
- QueryCacheManager.cs
- DecimalAnimationUsingKeyFrames.cs
- TailCallAnalyzer.cs
- XPathNodeInfoAtom.cs
- figurelength.cs
- ButtonStandardAdapter.cs