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
- SqlDataSource.cs
- SHA512.cs
- ClientCultureInfo.cs
- ServiceReflector.cs
- MatrixTransform3D.cs
- Mapping.cs
- UIHelper.cs
- GridViewEditEventArgs.cs
- WpfXamlMember.cs
- HwndSourceParameters.cs
- ThreadAbortException.cs
- DecimalAnimationBase.cs
- EmbeddedMailObjectsCollection.cs
- TextChange.cs
- CircleEase.cs
- ImageAutomationPeer.cs
- ActivityTypeCodeDomSerializer.cs
- StorageMappingItemCollection.cs
- precedingquery.cs
- HttpRuntimeSection.cs
- ISCIIEncoding.cs
- SqlErrorCollection.cs
- BeginSelectCardRequest.cs
- EdmSchemaAttribute.cs
- GridViewSortEventArgs.cs
- RepeatEnumerable.cs
- Normalization.cs
- CapabilitiesPattern.cs
- __Filters.cs
- HScrollProperties.cs
- AccessedThroughPropertyAttribute.cs
- ControlAdapter.cs
- ConvertersCollection.cs
- NoPersistScope.cs
- WmlPhoneCallAdapter.cs
- PageAsyncTask.cs
- ParameterBinding.cs
- MDIClient.cs
- UserInitiatedRoutedEventPermission.cs
- XamlStyleSerializer.cs
- CoreChannel.cs
- SHA256CryptoServiceProvider.cs
- CodeTypeDelegate.cs
- DataGridViewRowPostPaintEventArgs.cs
- SerializationSectionGroup.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- UnknownBitmapDecoder.cs
- TableItemPatternIdentifiers.cs
- SingleResultAttribute.cs
- AstNode.cs
- NetworkCredential.cs
- SqlConnectionString.cs
- Reference.cs
- FullTextState.cs
- counter.cs
- DiffuseMaterial.cs
- NotImplementedException.cs
- XhtmlStyleClass.cs
- ObjectPersistData.cs
- Image.cs
- RawStylusInputCustomDataList.cs
- Mouse.cs
- UnsafeNativeMethods.cs
- UserPreferenceChangedEventArgs.cs
- X500Name.cs
- Drawing.cs
- KeyedQueue.cs
- Vector3DAnimationUsingKeyFrames.cs
- HandlerBase.cs
- FrameworkContentElementAutomationPeer.cs
- Byte.cs
- ChtmlLinkAdapter.cs
- WebPartEditorApplyVerb.cs
- FixUp.cs
- WebConfigurationFileMap.cs
- ProvidersHelper.cs
- PasswordTextContainer.cs
- Util.cs
- AttributeUsageAttribute.cs
- SafeNativeMethods.cs
- DiscreteKeyFrames.cs
- ListCollectionView.cs
- Splitter.cs
- SHA1CryptoServiceProvider.cs
- WeakEventTable.cs
- ConfigurationStrings.cs
- CacheChildrenQuery.cs
- RenderDataDrawingContext.cs
- RepeatInfo.cs
- IImplicitResourceProvider.cs
- MetadataLocation.cs
- UnSafeCharBuffer.cs
- DebugInfoGenerator.cs
- Reference.cs
- XmlSerializerOperationFormatter.cs
- EntryWrittenEventArgs.cs
- SiteMapNodeCollection.cs
- PageClientProxyGenerator.cs
- InfoCardSymmetricCrypto.cs
- WindowsListViewItem.cs