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
- Binding.cs
- XmlSerializerAssemblyAttribute.cs
- Vector3DAnimationBase.cs
- AnchoredBlock.cs
- NavigationCommands.cs
- TemplateFactory.cs
- CellQuery.cs
- PointCollection.cs
- SQLInt32Storage.cs
- SvcMapFileSerializer.cs
- FaultContractAttribute.cs
- Fonts.cs
- TextContainer.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- WinFormsSpinner.cs
- ProxyWebPartManager.cs
- HttpListenerResponse.cs
- HitTestResult.cs
- ValidationHelper.cs
- ToolTipAutomationPeer.cs
- XmlObjectSerializerReadContext.cs
- HashCoreRequest.cs
- AlgoModule.cs
- LocalTransaction.cs
- Expressions.cs
- SecurityDescriptor.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- LoginUtil.cs
- PathSegment.cs
- ComponentCodeDomSerializer.cs
- WebDescriptionAttribute.cs
- GetCryptoTransformRequest.cs
- NextPreviousPagerField.cs
- SafeNativeMethods.cs
- DefaultParameterValueAttribute.cs
- CharAnimationUsingKeyFrames.cs
- DependencySource.cs
- EmptyEnumerator.cs
- OperationAbortedException.cs
- EntityDataSourceEntitySetNameItem.cs
- NavigationProperty.cs
- FileSecurity.cs
- TableRow.cs
- AnimationClock.cs
- ValidationErrorCollection.cs
- WindowsScroll.cs
- jithelpers.cs
- MethodExpr.cs
- TemplateBamlRecordReader.cs
- ConnectionInterfaceCollection.cs
- ReferenceSchema.cs
- HtmlElementErrorEventArgs.cs
- LiteralLink.cs
- WebPartEventArgs.cs
- SessionStateModule.cs
- TableParagraph.cs
- HandlerBase.cs
- EnlistmentTraceIdentifier.cs
- AppSettings.cs
- DataExpression.cs
- TextEffectResolver.cs
- ContentPosition.cs
- VirtualizingStackPanel.cs
- GridViewDeleteEventArgs.cs
- EntityContainer.cs
- PeerTransportListenAddressConverter.cs
- PeerApplication.cs
- DataRelation.cs
- RangeValidator.cs
- FactoryRecord.cs
- SecurityState.cs
- MetadataCache.cs
- EntityDataSourceChangedEventArgs.cs
- IdentityHolder.cs
- SizeValueSerializer.cs
- SafeEventLogReadHandle.cs
- CngAlgorithmGroup.cs
- MachineSettingsSection.cs
- AudienceUriMode.cs
- DllNotFoundException.cs
- CheckBoxField.cs
- FixedPage.cs
- DBCSCodePageEncoding.cs
- Point3DIndependentAnimationStorage.cs
- ProjectedSlot.cs
- BinaryEditor.cs
- DockProviderWrapper.cs
- TemplateBaseAction.cs
- XmlRawWriterWrapper.cs
- BrowserDefinition.cs
- _LocalDataStore.cs
- OlePropertyStructs.cs
- RelationshipWrapper.cs
- XNodeNavigator.cs
- WhitespaceRule.cs
- XmlSchemaAttributeGroup.cs
- DateTimeConstantAttribute.cs
- PriorityQueue.cs
- ExpandCollapseProviderWrapper.cs
- QueryCorrelationInitializer.cs