Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XmlCountingReader.cs
- PenThread.cs
- StorageEndPropertyMapping.cs
- FragmentNavigationEventArgs.cs
- TagMapInfo.cs
- DbReferenceCollection.cs
- MachineKeySection.cs
- FileFormatException.cs
- Zone.cs
- StaticTextPointer.cs
- ApplicationActivator.cs
- CheckoutException.cs
- TypeBuilderInstantiation.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- RemotingException.cs
- SafeNativeMethodsMilCoreApi.cs
- DataStreamFromComStream.cs
- MultipartContentParser.cs
- EventMap.cs
- TextTreeInsertUndoUnit.cs
- Expr.cs
- CodeConstructor.cs
- ResolveCriteria.cs
- SqlInternalConnectionSmi.cs
- EventLogEntry.cs
- VSDExceptions.cs
- DbMetaDataFactory.cs
- InputManager.cs
- WizardStepBase.cs
- VisualStyleInformation.cs
- TableCellCollection.cs
- StreamFormatter.cs
- SafeNativeMethods.cs
- CompiledXpathExpr.cs
- ResourceCodeDomSerializer.cs
- XamlTypeMapper.cs
- COSERVERINFO.cs
- LicFileLicenseProvider.cs
- Animatable.cs
- Span.cs
- _NtlmClient.cs
- BamlMapTable.cs
- _SslStream.cs
- WhitespaceRuleLookup.cs
- TaiwanCalendar.cs
- SqlTransaction.cs
- FontDriver.cs
- ViewPort3D.cs
- PasswordRecovery.cs
- RtfFormatStack.cs
- MimeObjectFactory.cs
- DataControlLinkButton.cs
- PermissionToken.cs
- ResolveNameEventArgs.cs
- EventLogWatcher.cs
- RootBrowserWindowAutomationPeer.cs
- Directory.cs
- RootBrowserWindowAutomationPeer.cs
- _SingleItemRequestCache.cs
- GridViewAutoFormat.cs
- Visual3D.cs
- EncryptedPackage.cs
- BindingContext.cs
- SimpleTypeResolver.cs
- SplineKeyFrames.cs
- WmpBitmapEncoder.cs
- AppDomainFactory.cs
- ObjectNavigationPropertyMapping.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- NavigatorOutput.cs
- MissingSatelliteAssemblyException.cs
- OleDbParameter.cs
- Debug.cs
- PageAsyncTaskManager.cs
- XPathNavigatorReader.cs
- XsltSettings.cs
- MediaTimeline.cs
- ProtectedConfiguration.cs
- SessionSwitchEventArgs.cs
- SortFieldComparer.cs
- Pkcs9Attribute.cs
- EntityDataSourceChangingEventArgs.cs
- KeyGesture.cs
- SecurityCriticalDataForSet.cs
- precedingsibling.cs
- AudienceUriMode.cs
- PersonalizationProviderCollection.cs
- DesignerForm.cs
- Point.cs
- PerformanceCounterPermission.cs
- DataBoundLiteralControl.cs
- TabPage.cs
- HttpProfileBase.cs
- AppDomainUnloadedException.cs
- JoinGraph.cs
- StrokeNodeData.cs
- Span.cs
- codemethodreferenceexpression.cs
- Opcode.cs
- BinaryEditor.cs