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
- MulticastNotSupportedException.cs
- OptimalBreakSession.cs
- DependencyPropertyChangedEventArgs.cs
- StringFunctions.cs
- GridViewColumnCollection.cs
- TypeLibConverter.cs
- Mouse.cs
- RootBrowserWindowProxy.cs
- SecurityRuntime.cs
- XomlCompilerHelpers.cs
- Size3DConverter.cs
- BufferedStream.cs
- ComponentChangingEvent.cs
- TypeRefElement.cs
- CheckBoxPopupAdapter.cs
- QuaternionAnimation.cs
- TableCellAutomationPeer.cs
- EntityClientCacheEntry.cs
- HttpTransportSecurityElement.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- TriggerCollection.cs
- Events.cs
- AutomationPeer.cs
- CatalogPart.cs
- ContractAdapter.cs
- DynamicObject.cs
- CompModSwitches.cs
- ConnectionInterfaceCollection.cs
- Int64.cs
- PerformanceCounterPermission.cs
- WebConfigurationHost.cs
- SimpleType.cs
- InternalEnumValidatorAttribute.cs
- _SSPISessionCache.cs
- SiteMapSection.cs
- SignatureDescription.cs
- SqlReorderer.cs
- ParseChildrenAsPropertiesAttribute.cs
- SizeChangedInfo.cs
- DesignTimeTemplateParser.cs
- ComponentChangedEvent.cs
- ExclusiveTcpTransportManager.cs
- MediaElement.cs
- DataGridClipboardHelper.cs
- OleDbCommand.cs
- FilterableAttribute.cs
- AnnotationMap.cs
- configsystem.cs
- _CacheStreams.cs
- XmlNamespaceDeclarationsAttribute.cs
- SerializationException.cs
- ItemAutomationPeer.cs
- COM2TypeInfoProcessor.cs
- errorpatternmatcher.cs
- IApplicationTrustManager.cs
- HashMembershipCondition.cs
- IteratorDescriptor.cs
- FixedSOMLineCollection.cs
- XslAst.cs
- VirtualPath.cs
- PackageDigitalSignature.cs
- webeventbuffer.cs
- NetworkStream.cs
- NamespaceInfo.cs
- DictionaryBase.cs
- DeploymentSection.cs
- EncodingTable.cs
- MobileControlDesigner.cs
- SafeCoTaskMem.cs
- PageAdapter.cs
- MLangCodePageEncoding.cs
- DefaultProfileManager.cs
- XmlArrayItemAttributes.cs
- SecurityRuntime.cs
- IxmlLineInfo.cs
- BindUriHelper.cs
- ValidatingReaderNodeData.cs
- SoapIncludeAttribute.cs
- ConnectionConsumerAttribute.cs
- ListControlDesigner.cs
- EnumCodeDomSerializer.cs
- SamlAssertionKeyIdentifierClause.cs
- ValidationError.cs
- Int16Converter.cs
- CodeIdentifiers.cs
- NumericPagerField.cs
- UriWriter.cs
- MenuAutomationPeer.cs
- MatchNoneMessageFilter.cs
- ConnectionPointGlyph.cs
- MailSettingsSection.cs
- Stopwatch.cs
- ListViewGroupItemCollection.cs
- StringFormat.cs
- HandlerBase.cs
- EntityDataSourceConfigureObjectContext.cs
- InstanceLockedException.cs
- HttpEncoder.cs
- XmlReflectionImporter.cs
- ProtectedConfiguration.cs