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
- BasicHttpBinding.cs
- BaseUriHelper.cs
- SqlDataSourceQueryEditor.cs
- ConversionContext.cs
- ColorTransformHelper.cs
- ForeignConstraint.cs
- HtmlTableRowCollection.cs
- CharacterHit.cs
- Viewport3DAutomationPeer.cs
- TimeSpan.cs
- RoleManagerSection.cs
- Debug.cs
- MatcherBuilder.cs
- TriggerAction.cs
- StrokeDescriptor.cs
- ControlCodeDomSerializer.cs
- HtmlControl.cs
- EventProvider.cs
- DataGridViewComboBoxCell.cs
- WizardPanelChangingEventArgs.cs
- SimpleApplicationHost.cs
- DesignerSerializationVisibilityAttribute.cs
- UniqueIdentifierService.cs
- ConfigurationSection.cs
- ElementFactory.cs
- BaseDataListActionList.cs
- SiteMapHierarchicalDataSourceView.cs
- IndexingContentUnit.cs
- NetSectionGroup.cs
- BridgeDataRecord.cs
- Subtree.cs
- ListControlStringCollectionEditor.cs
- TablePatternIdentifiers.cs
- NullRuntimeConfig.cs
- MailHeaderInfo.cs
- Parallel.cs
- CellQuery.cs
- EventListener.cs
- InstanceContextManager.cs
- TypeReference.cs
- VisualTransition.cs
- SourceChangedEventArgs.cs
- Rectangle.cs
- XamlClipboardData.cs
- ServiceAuthorizationManager.cs
- DiscoveryServerProtocol.cs
- DataListGeneralPage.cs
- OrthographicCamera.cs
- FileDialogCustomPlacesCollection.cs
- Model3D.cs
- FlowLayout.cs
- Debug.cs
- ParameterRetriever.cs
- DocumentOrderQuery.cs
- XmlDataLoader.cs
- InvalidComObjectException.cs
- CounterSetInstance.cs
- HtmlEmptyTagControlBuilder.cs
- XmlTextReader.cs
- ParamArrayAttribute.cs
- HttpPostClientProtocol.cs
- ReflectPropertyDescriptor.cs
- FieldAccessException.cs
- BackStopAuthenticationModule.cs
- DataSourceCache.cs
- PathFigure.cs
- ScriptMethodAttribute.cs
- HeaderedContentControl.cs
- UdpRetransmissionSettings.cs
- FileSystemInfo.cs
- IResourceProvider.cs
- ICspAsymmetricAlgorithm.cs
- DirectoryInfo.cs
- XmlSerializerFactory.cs
- CommonProperties.cs
- SingleStorage.cs
- TrackingServices.cs
- TextSpanModifier.cs
- FixedSOMTableRow.cs
- PenThread.cs
- WebResourceAttribute.cs
- XmlEventCache.cs
- initElementDictionary.cs
- CodeAttachEventStatement.cs
- CFGGrammar.cs
- DrawingBrush.cs
- ClientProxyGenerator.cs
- CallbackValidatorAttribute.cs
- EventPropertyMap.cs
- SqlFacetAttribute.cs
- SerialStream.cs
- CompiledXpathExpr.cs
- ConfigXmlReader.cs
- DBAsyncResult.cs
- CurrentChangedEventManager.cs
- Button.cs
- DPTypeDescriptorContext.cs
- Suspend.cs
- XmlQueryType.cs
- GridViewAutomationPeer.cs