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
- Stroke2.cs
- Rfc2898DeriveBytes.cs
- XmlIterators.cs
- DateTimeValueSerializerContext.cs
- HttpListenerRequest.cs
- ToolStripLocationCancelEventArgs.cs
- EntitySqlQueryCacheKey.cs
- LocalClientSecuritySettingsElement.cs
- ListViewItemCollectionEditor.cs
- RectAnimation.cs
- AppDomainGrammarProxy.cs
- Pool.cs
- MsmqIntegrationSecurity.cs
- MessageFormatterConverter.cs
- UnsafeNativeMethodsCLR.cs
- TimeSpanValidatorAttribute.cs
- ObjectDataProvider.cs
- UIElementPropertyUndoUnit.cs
- ConcurrentStack.cs
- BaseCollection.cs
- Panel.cs
- PropagatorResult.cs
- XmlSchemaAttributeGroup.cs
- ProfileInfo.cs
- EdmConstants.cs
- QilInvokeLateBound.cs
- SmiRecordBuffer.cs
- CustomLineCap.cs
- OdbcConnectionHandle.cs
- DateTimePicker.cs
- SiteMapNodeItem.cs
- HostExecutionContextManager.cs
- CapiSafeHandles.cs
- DbTransaction.cs
- IDispatchConstantAttribute.cs
- OlePropertyStructs.cs
- WinFormsSecurity.cs
- HttpDebugHandler.cs
- ValueSerializer.cs
- TypedRowGenerator.cs
- IODescriptionAttribute.cs
- TimeZoneInfo.cs
- WorkerRequest.cs
- ProcessMessagesAsyncResult.cs
- GlobalizationSection.cs
- MDIClient.cs
- FrameworkElementFactory.cs
- XmlSerializerAssemblyAttribute.cs
- FixedDocument.cs
- MSG.cs
- StringAnimationUsingKeyFrames.cs
- SqlMultiplexer.cs
- MenuItemBinding.cs
- ItemCollection.cs
- sqlpipe.cs
- RegexRunner.cs
- Geometry3D.cs
- SiteMapHierarchicalDataSourceView.cs
- DataTable.cs
- Operator.cs
- ServiceModelConfigurationSectionCollection.cs
- PeerNodeTraceRecord.cs
- PasswordDeriveBytes.cs
- XmlDataSourceView.cs
- MetadataCollection.cs
- PackagePart.cs
- OracleRowUpdatingEventArgs.cs
- CurrencyWrapper.cs
- PinnedBufferMemoryStream.cs
- ZipIOFileItemStream.cs
- ToolstripProfessionalRenderer.cs
- NullRuntimeConfig.cs
- VSDExceptions.cs
- StringUtil.cs
- Vector3DAnimationUsingKeyFrames.cs
- ProgressBarAutomationPeer.cs
- TextBoxDesigner.cs
- SqlReorderer.cs
- CodeCatchClauseCollection.cs
- UiaCoreApi.cs
- NullReferenceException.cs
- _ListenerAsyncResult.cs
- SynchronizedDispatch.cs
- FrameworkElement.cs
- SystemIPGlobalStatistics.cs
- BrowserInteropHelper.cs
- XmlMapping.cs
- DataProtection.cs
- CommandHelpers.cs
- WebPartTransformerCollection.cs
- NGCPageContentCollectionSerializerAsync.cs
- FixedSOMTable.cs
- nulltextnavigator.cs
- PropertyFilterAttribute.cs
- WebPartMenuStyle.cs
- FilterElement.cs
- PtsHelper.cs
- HistoryEventArgs.cs
- SmiConnection.cs
- _ScatterGatherBuffers.cs