Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / BasicKeyConstraint.cs / 1305376 / 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, MemberProjectedSlot.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 (MemberProjectedSlot 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, MemberProjectedSlot.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 (MemberProjectedSlot 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
- GenericArgumentsUpdater.cs
- UshortList2.cs
- EntityRecordInfo.cs
- Baml2006SchemaContext.cs
- TemplatedEditableDesignerRegion.cs
- XPathMessageFilterElementCollection.cs
- FutureFactory.cs
- AdjustableArrowCap.cs
- InkCanvasSelection.cs
- PeerNameRecord.cs
- StateMachine.cs
- Int32CollectionConverter.cs
- ScrollChrome.cs
- RequestNavigateEventArgs.cs
- TableColumnCollectionInternal.cs
- ClickablePoint.cs
- ControlBindingsConverter.cs
- HtmlShimManager.cs
- DataGridViewTextBoxColumn.cs
- CustomCredentialPolicy.cs
- PenContexts.cs
- MarkerProperties.cs
- PrePrepareMethodAttribute.cs
- EntityCommandExecutionException.cs
- TypeUsageBuilder.cs
- GatewayIPAddressInformationCollection.cs
- Font.cs
- Utils.cs
- DesigntimeLicenseContextSerializer.cs
- LiteralControl.cs
- TableDetailsRow.cs
- SafePEFileHandle.cs
- StickyNote.cs
- XmlCharCheckingWriter.cs
- UserValidatedEventArgs.cs
- PeerCollaborationPermission.cs
- SafeNativeMethods.cs
- PropertyTabChangedEvent.cs
- propertyentry.cs
- IsolatedStorageException.cs
- DataReceivedEventArgs.cs
- AttachedPropertyBrowsableAttribute.cs
- NamespaceEmitter.cs
- MarginCollapsingState.cs
- XmlAttributeHolder.cs
- OpCodes.cs
- CompilerGeneratedAttribute.cs
- _HelperAsyncResults.cs
- ByteStorage.cs
- CfgRule.cs
- VirtualizingPanel.cs
- SqlExpressionNullability.cs
- CapabilitiesUse.cs
- SharedConnectionWorkflowTransactionService.cs
- ReadContentAsBinaryHelper.cs
- XmlMemberMapping.cs
- SqlNode.cs
- DesignerInterfaces.cs
- TableCell.cs
- ControlBuilder.cs
- DataSourceView.cs
- Win32Native.cs
- ImageSourceValueSerializer.cs
- Tool.cs
- Transform3D.cs
- DateRangeEvent.cs
- IPPacketInformation.cs
- ItemCollection.cs
- OutputCacheSection.cs
- CodeGroup.cs
- SqlInternalConnectionSmi.cs
- ClientBuildManager.cs
- Boolean.cs
- TransactionContext.cs
- Drawing.cs
- TrustManagerMoreInformation.cs
- WebScriptEndpointElement.cs
- CustomLineCap.cs
- ReferenceService.cs
- UnionCodeGroup.cs
- contentDescriptor.cs
- ReflectionUtil.cs
- XmlChoiceIdentifierAttribute.cs
- Pen.cs
- DefaultProxySection.cs
- ContainerVisual.cs
- PrimitiveRenderer.cs
- OleDbEnumerator.cs
- CqlLexer.cs
- SiteMapDesignerDataSourceView.cs
- ViewStateModeByIdAttribute.cs
- EnumerableCollectionView.cs
- AmbiguousMatchException.cs
- XmlExceptionHelper.cs
- _Connection.cs
- unsafenativemethodsother.cs
- FontStyleConverter.cs
- PrintingPermission.cs
- AuditLog.cs
- SmtpNetworkElement.cs