Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- RequestTimeoutManager.cs
- GetFileNameResult.cs
- RectangleHotSpot.cs
- WsatAdminException.cs
- DBCommandBuilder.cs
- ParserStack.cs
- IxmlLineInfo.cs
- SystemIcons.cs
- CodeAttributeArgument.cs
- TextBoxView.cs
- CodeAccessPermission.cs
- SeekStoryboard.cs
- XmlSchemaDatatype.cs
- CurrentTimeZone.cs
- DataRowExtensions.cs
- WebZone.cs
- Equal.cs
- Misc.cs
- PackUriHelper.cs
- FillRuleValidation.cs
- HuffmanTree.cs
- GridViewRowCollection.cs
- HelpHtmlBuilder.cs
- XmlLinkedNode.cs
- _SslStream.cs
- SapiGrammar.cs
- WindowsAuthenticationModule.cs
- sqlpipe.cs
- CompilationUnit.cs
- HtmlTernaryTree.cs
- HighContrastHelper.cs
- DataGridCaption.cs
- ProfileGroupSettings.cs
- Update.cs
- SafeNativeMethods.cs
- OutputCacheSettings.cs
- MetadataCache.cs
- ColumnMapTranslator.cs
- ReadOnlyDataSource.cs
- MultiSelector.cs
- EmptyEnumerator.cs
- IntegerValidator.cs
- ObjectStateEntryDbDataRecord.cs
- ValueTable.cs
- SR.cs
- ISFClipboardData.cs
- XamlToRtfParser.cs
- MulticastOption.cs
- TypeBuilder.cs
- TextBounds.cs
- NativeMethods.cs
- TableRowCollection.cs
- EnlistmentTraceIdentifier.cs
- safePerfProviderHandle.cs
- COM2ExtendedUITypeEditor.cs
- FormViewModeEventArgs.cs
- RichTextBoxConstants.cs
- PublishLicense.cs
- XmlSerializerFactory.cs
- NotificationContext.cs
- AsyncInvokeContext.cs
- TraceAsyncResult.cs
- LayoutEditorPart.cs
- StylusShape.cs
- PageParserFilter.cs
- FlowLayoutPanel.cs
- ObjectQuery.cs
- ProjectionCamera.cs
- CompressStream.cs
- EFAssociationProvider.cs
- HScrollBar.cs
- ListViewDeletedEventArgs.cs
- AliasedSlot.cs
- initElementDictionary.cs
- Deflater.cs
- ControlBindingsCollection.cs
- TransportContext.cs
- DesignerObjectListAdapter.cs
- SafeRegistryHandle.cs
- DashStyle.cs
- ProxySimple.cs
- VBCodeProvider.cs
- MultiView.cs
- SqlCacheDependencyDatabase.cs
- wgx_commands.cs
- AmbientLight.cs
- FormatControl.cs
- CombinedGeometry.cs
- FreezableDefaultValueFactory.cs
- Socket.cs
- SiteMembershipCondition.cs
- MonthChangedEventArgs.cs
- Win32.cs
- MouseCaptureWithinProperty.cs
- UrlPath.cs
- PagedControl.cs
- TrustLevelCollection.cs
- SmtpNegotiateAuthenticationModule.cs
- EdmComplexPropertyAttribute.cs
- MergeEnumerator.cs