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
- QueryExpr.cs
- EngineSite.cs
- ApplicationDirectoryMembershipCondition.cs
- TypeResolvingOptionsAttribute.cs
- DeobfuscatingStream.cs
- GridPattern.cs
- CollectionChangeEventArgs.cs
- SchemaNotation.cs
- Floater.cs
- XmlValueConverter.cs
- HeaderUtility.cs
- ItemType.cs
- ResourceCategoryAttribute.cs
- NullRuntimeConfig.cs
- KeyValuePairs.cs
- LockedAssemblyCache.cs
- DrawingVisualDrawingContext.cs
- EnumUnknown.cs
- SoapMessage.cs
- DesignerDataTable.cs
- ErrorEventArgs.cs
- ListControlBoundActionList.cs
- BamlWriter.cs
- SqlClientPermission.cs
- BrowserCapabilitiesFactory.cs
- BoolExpression.cs
- DataContract.cs
- SecurityPolicySection.cs
- HtmlInputButton.cs
- XslCompiledTransform.cs
- StructuralCache.cs
- InstanceDataCollection.cs
- IndentedTextWriter.cs
- MLangCodePageEncoding.cs
- CultureTable.cs
- ResourceContainer.cs
- MonthChangedEventArgs.cs
- StrokeNodeEnumerator.cs
- Thumb.cs
- EditingMode.cs
- InkCanvas.cs
- RectangleGeometry.cs
- MethodExpr.cs
- DataGrid.cs
- InfoCardRSACryptoProvider.cs
- FontDialog.cs
- CompilerScope.cs
- SuspendDesigner.cs
- StringValueSerializer.cs
- FlowDocumentReader.cs
- HostedAspNetEnvironment.cs
- SharedPersonalizationStateInfo.cs
- WebBrowserDesigner.cs
- GetCertificateRequest.cs
- DrawListViewSubItemEventArgs.cs
- DocumentPageHost.cs
- CallbackValidatorAttribute.cs
- InternalControlCollection.cs
- TCPListener.cs
- SafeRightsManagementPubHandle.cs
- SqlServer2KCompatibilityCheck.cs
- UriSection.cs
- EncodingInfo.cs
- XmlIgnoreAttribute.cs
- TextElementAutomationPeer.cs
- InvalidDocumentContentsException.cs
- StylusCollection.cs
- TemplateXamlTreeBuilder.cs
- _LoggingObject.cs
- WizardForm.cs
- embossbitmapeffect.cs
- EntityObject.cs
- GlobalizationAssembly.cs
- MimeBasePart.cs
- SecurityTokenException.cs
- TemplateEditingService.cs
- HighlightComponent.cs
- MetadataProperty.cs
- TextEvent.cs
- PeerMessageDispatcher.cs
- XmlAttributeProperties.cs
- HiddenFieldPageStatePersister.cs
- TextBoxBase.cs
- AppDomainShutdownMonitor.cs
- __ConsoleStream.cs
- TextBoxAutomationPeer.cs
- ColorAnimationBase.cs
- ProxyDataContractResolver.cs
- Stack.cs
- LambdaCompiler.Logical.cs
- ReferenceList.cs
- SecurityTokenException.cs
- CharacterMetricsDictionary.cs
- DuplexSecurityProtocolFactory.cs
- _Rfc2616CacheValidators.cs
- ToolStripComboBox.cs
- QilXmlReader.cs
- ArrayTypeMismatchException.cs
- MasterPageCodeDomTreeGenerator.cs
- RequestTimeoutManager.cs