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
- SqlVisitor.cs
- DataGridCellClipboardEventArgs.cs
- ReliabilityContractAttribute.cs
- FieldAccessException.cs
- BasicCellRelation.cs
- PipelineModuleStepContainer.cs
- InputLanguageEventArgs.cs
- ContextProperty.cs
- SplayTreeNode.cs
- TypeLoadException.cs
- GenericTypeParameterConverter.cs
- EmbeddedObject.cs
- XmlSchemaValidator.cs
- BaseServiceProvider.cs
- KeyProperty.cs
- ValueTable.cs
- XPathAxisIterator.cs
- Wizard.cs
- AutomationPatternInfo.cs
- NativeMethods.cs
- DbMetaDataFactory.cs
- ClientTarget.cs
- HScrollBar.cs
- DPCustomTypeDescriptor.cs
- PeerNameRegistration.cs
- StringFreezingAttribute.cs
- BuiltInExpr.cs
- BindingNavigator.cs
- ConfigXmlWhitespace.cs
- AlgoModule.cs
- TextWriter.cs
- Expander.cs
- PropertyMapper.cs
- DBParameter.cs
- _OSSOCK.cs
- WebHttpBehavior.cs
- SecurityTokenValidationException.cs
- NamespaceEmitter.cs
- MaterializeFromAtom.cs
- PropertyGridCommands.cs
- SrgsElementList.cs
- ObjectStorage.cs
- PixelFormat.cs
- CodeCompileUnit.cs
- ClientRuntimeConfig.cs
- WebConfigurationHost.cs
- ToolStripSystemRenderer.cs
- TreeBuilder.cs
- CommandHelper.cs
- SafeRightsManagementHandle.cs
- OrthographicCamera.cs
- HasRunnableWorkflowEvent.cs
- DropShadowEffect.cs
- SmiRequestExecutor.cs
- XmlnsCache.cs
- StylusButtonEventArgs.cs
- DialogWindow.cs
- DataGrid.cs
- NewArrayExpression.cs
- GACMembershipCondition.cs
- OperatingSystem.cs
- BasicBrowserDialog.designer.cs
- DescendentsWalker.cs
- InvokeMethod.cs
- TypeElement.cs
- SupportingTokenAuthenticatorSpecification.cs
- BinaryParser.cs
- LookupTables.cs
- Stylesheet.cs
- Vertex.cs
- SerializationFieldInfo.cs
- Triangle.cs
- LinqDataSourceContextEventArgs.cs
- ReliabilityContractAttribute.cs
- XPathArrayIterator.cs
- Psha1DerivedKeyGenerator.cs
- HtmlInputCheckBox.cs
- DnsEndpointIdentity.cs
- TransformGroup.cs
- NoneExcludedImageIndexConverter.cs
- DbExpressionVisitor.cs
- ListSortDescriptionCollection.cs
- StringTraceRecord.cs
- StartUpEventArgs.cs
- AuthenticationConfig.cs
- RegistryExceptionHelper.cs
- Tablet.cs
- ClassImporter.cs
- StatusBarDrawItemEvent.cs
- ToolBar.cs
- GridViewAutoFormat.cs
- arc.cs
- XamlWriter.cs
- EncryptedReference.cs
- PointLight.cs
- Parameter.cs
- PtsContext.cs
- IISMapPath.cs
- SafeArrayRankMismatchException.cs
- OleDbParameter.cs