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
- SmtpException.cs
- FixedTextSelectionProcessor.cs
- PrePostDescendentsWalker.cs
- XsltLibrary.cs
- HtmlCalendarAdapter.cs
- SignedInfo.cs
- ColorAnimation.cs
- DropSource.cs
- ObjectViewFactory.cs
- RegexInterpreter.cs
- BatchStream.cs
- ClockGroup.cs
- WindowsTooltip.cs
- InternalBufferManager.cs
- EventLogPermission.cs
- FormViewPageEventArgs.cs
- CustomAttribute.cs
- MulticastNotSupportedException.cs
- Hex.cs
- PtsHost.cs
- CodeDOMProvider.cs
- ScaleTransform3D.cs
- QilFunction.cs
- AdornerPresentationContext.cs
- WorkflowMarkupSerializer.cs
- ServiceObjectContainer.cs
- NegationPusher.cs
- SqlExpander.cs
- DrawingGroup.cs
- WpfWebRequestHelper.cs
- LinkedResourceCollection.cs
- OracleFactory.cs
- Helpers.cs
- Transform.cs
- HttpRequestContext.cs
- EnumMember.cs
- _LocalDataStore.cs
- Vector3DKeyFrameCollection.cs
- EnterpriseServicesHelper.cs
- FontUnit.cs
- OlePropertyStructs.cs
- ProtocolsInstallComponent.cs
- AssemblyInfo.cs
- _AcceptOverlappedAsyncResult.cs
- DescendantBaseQuery.cs
- XmlEntityReference.cs
- IxmlLineInfo.cs
- MaterializeFromAtom.cs
- ParameterModifier.cs
- Select.cs
- SoapEnumAttribute.cs
- ProgressBar.cs
- HttpListenerPrefixCollection.cs
- SqlCrossApplyToCrossJoin.cs
- XmlQualifiedNameTest.cs
- CroppedBitmap.cs
- DbUpdateCommandTree.cs
- ManagedFilter.cs
- OdbcUtils.cs
- Select.cs
- HotSpot.cs
- SequenceRangeCollection.cs
- ConfigurationException.cs
- ZipIOCentralDirectoryBlock.cs
- XmlUtil.cs
- ByteAnimationUsingKeyFrames.cs
- RuntimeEnvironment.cs
- DataGridViewRowStateChangedEventArgs.cs
- ResolveResponseInfo.cs
- WebServiceEndpoint.cs
- Bitmap.cs
- DateTimeStorage.cs
- HttpCacheVaryByContentEncodings.cs
- DefaultTraceListener.cs
- DbProviderManifest.cs
- Rights.cs
- ViewManagerAttribute.cs
- Models.cs
- SortedDictionary.cs
- X509Extension.cs
- sqlcontext.cs
- FileInfo.cs
- SearchExpression.cs
- ImageBrush.cs
- DataGridCell.cs
- EditorResources.cs
- WebPartActionVerb.cs
- UnsafeNativeMethods.cs
- ReferenceEqualityComparer.cs
- LinearGradientBrush.cs
- SerializationHelper.cs
- activationcontext.cs
- ColorPalette.cs
- Int16AnimationUsingKeyFrames.cs
- DataGridViewRow.cs
- ReferenceSchema.cs
- Double.cs
- CopyNamespacesAction.cs
- WindowsRegion.cs
- TableLayoutPanelCellPosition.cs