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
- PassportAuthentication.cs
- TriggerBase.cs
- MenuItemStyle.cs
- StateWorkerRequest.cs
- PropertyPath.cs
- XamlGridLengthSerializer.cs
- ServiceMemoryGates.cs
- XmlSchemaAnnotation.cs
- ProvidersHelper.cs
- XmlStreamNodeWriter.cs
- DocumentsTrace.cs
- PlainXmlDeserializer.cs
- UTF7Encoding.cs
- RouteValueDictionary.cs
- EventLogEntryCollection.cs
- QilGenerator.cs
- InputBuffer.cs
- ProviderCollection.cs
- Point.cs
- BuildProvider.cs
- InvalidOleVariantTypeException.cs
- XmlSiteMapProvider.cs
- Stack.cs
- TextMetrics.cs
- ObfuscateAssemblyAttribute.cs
- UInt64.cs
- DocumentOutline.cs
- ContentDisposition.cs
- ContractHandle.cs
- UnsafeNativeMethods.cs
- DataGridCell.cs
- FixedTextBuilder.cs
- FieldNameLookup.cs
- ClaimComparer.cs
- CollectionViewGroup.cs
- PropertyIDSet.cs
- TextBounds.cs
- TableAutomationPeer.cs
- DoubleUtil.cs
- DataViewManagerListItemTypeDescriptor.cs
- ContextMenu.cs
- EdmItemError.cs
- ReflectionPermission.cs
- UnknownBitmapDecoder.cs
- Array.cs
- MediaPlayer.cs
- UrlPath.cs
- AuditLevel.cs
- EnvironmentPermission.cs
- VisualCollection.cs
- TableChangeProcessor.cs
- ImageAutomationPeer.cs
- CompilationRelaxations.cs
- VirtualDirectoryMappingCollection.cs
- OrderPreservingPipeliningMergeHelper.cs
- Help.cs
- IpcServerChannel.cs
- Journal.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- UrlAuthorizationModule.cs
- StringSorter.cs
- EntityStoreSchemaFilterEntry.cs
- TextBoxDesigner.cs
- UserMapPath.cs
- ClrPerspective.cs
- FileDataSourceCache.cs
- StreamGeometry.cs
- TransformGroup.cs
- KeyTime.cs
- SqlInfoMessageEvent.cs
- While.cs
- GrowingArray.cs
- SessionStateContainer.cs
- DocumentReferenceCollection.cs
- ListControl.cs
- VirtualDirectoryMappingCollection.cs
- NonBatchDirectoryCompiler.cs
- SettingsContext.cs
- NativeMethods.cs
- PropertyAccessVisitor.cs
- InstancePersistenceEvent.cs
- MaterialGroup.cs
- SqlUtil.cs
- FunctionNode.cs
- WebServicesInteroperability.cs
- ProxyWebPart.cs
- OracleFactory.cs
- ClientFormsAuthenticationMembershipProvider.cs
- Int64Converter.cs
- ScriptServiceAttribute.cs
- TableLayout.cs
- Lease.cs
- QueryConverter.cs
- EntityContainer.cs
- TrackingServices.cs
- WebPartEditVerb.cs
- PerfCounterSection.cs
- AdornerDecorator.cs
- RemoveStoryboard.cs