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
- lengthconverter.cs
- MetabaseServerConfig.cs
- HtmlTableCellCollection.cs
- SwitchLevelAttribute.cs
- DiagnosticTrace.cs
- DateTimeFormatInfo.cs
- OciHandle.cs
- SortDescription.cs
- MultipleViewPattern.cs
- SqlEnums.cs
- ScrollItemPatternIdentifiers.cs
- ListItem.cs
- CopyNodeSetAction.cs
- BamlRecords.cs
- XmlMembersMapping.cs
- bidPrivateBase.cs
- TreeViewHitTestInfo.cs
- Label.cs
- LeaseManager.cs
- Visual.cs
- ProcessThreadDesigner.cs
- DataSpaceManager.cs
- DataGridDesigner.cs
- ObjectDisposedException.cs
- BamlMapTable.cs
- GeometryCombineModeValidation.cs
- Rotation3D.cs
- ObjectTag.cs
- DynamicRenderer.cs
- WebPartsPersonalizationAuthorization.cs
- MILUtilities.cs
- Utils.cs
- PropertyFilterAttribute.cs
- PkcsUtils.cs
- QilChoice.cs
- ExpandedProjectionNode.cs
- DynamicRendererThreadManager.cs
- PartitionResolver.cs
- SByteStorage.cs
- ChangeNode.cs
- DefaultCompensation.cs
- InvalidAsynchronousStateException.cs
- Descriptor.cs
- ResourceWriter.cs
- HttpModuleActionCollection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- DynamicRendererThreadManager.cs
- NotConverter.cs
- Expression.cs
- ConstraintCollection.cs
- UInt32.cs
- UmAlQuraCalendar.cs
- ValueCollectionParameterReader.cs
- SyndicationSerializer.cs
- XhtmlBasicImageAdapter.cs
- AbsoluteQuery.cs
- XsltException.cs
- ThreadAbortException.cs
- CorrelationHandle.cs
- HttpFileCollection.cs
- CompiledQueryCacheKey.cs
- TemplateContent.cs
- BamlTreeUpdater.cs
- CssClassPropertyAttribute.cs
- TextTrailingCharacterEllipsis.cs
- SortKey.cs
- WebReferenceCollection.cs
- ProfileParameter.cs
- QilReplaceVisitor.cs
- ExtendedPropertyCollection.cs
- MethodBuilderInstantiation.cs
- MimeMultiPart.cs
- LOSFormatter.cs
- MemoryStream.cs
- TreeIterator.cs
- ExternalDataExchangeClient.cs
- Debug.cs
- XmlTextEncoder.cs
- DesigntimeLicenseContextSerializer.cs
- EventLogPermissionEntry.cs
- DynamicActivityXamlReader.cs
- ConfigsHelper.cs
- HttpResponseHeader.cs
- RecognitionEventArgs.cs
- DiscoveryDocumentLinksPattern.cs
- AVElementHelper.cs
- CompilerError.cs
- FtpWebRequest.cs
- Dispatcher.cs
- SqlGenericUtil.cs
- ReadWriteSpinLock.cs
- configsystem.cs
- dataobject.cs
- ProbeMatches11.cs
- Fx.cs
- SessionStateSection.cs
- ByteStreamMessageEncoder.cs
- AppLevelCompilationSectionCache.cs
- AttributeEmitter.cs
- XmlDataSourceView.cs