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
- _IPv6Address.cs
- MobileResource.cs
- AttachInfo.cs
- NotSupportedException.cs
- HostingEnvironment.cs
- TdsRecordBufferSetter.cs
- UIElementIsland.cs
- StrongNameUtility.cs
- LicFileLicenseProvider.cs
- IsolatedStoragePermission.cs
- ProjectionCamera.cs
- New.cs
- RemotingAttributes.cs
- DataGridLinkButton.cs
- SqlFunctionAttribute.cs
- TraceContextRecord.cs
- Mouse.cs
- ElementMarkupObject.cs
- ReplyChannel.cs
- DataControlLinkButton.cs
- EncodingTable.cs
- SpellerInterop.cs
- CurrencyWrapper.cs
- XmlReader.cs
- NamespaceCollection.cs
- ToolStripScrollButton.cs
- InvokeWebService.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- MsmqInputMessage.cs
- ObjectStateFormatter.cs
- iisPickupDirectory.cs
- FreezableOperations.cs
- GridItemCollection.cs
- IdentityManager.cs
- RangeValuePattern.cs
- AsyncOperationManager.cs
- ValidationErrorCollection.cs
- ProcessRequestArgs.cs
- BaseParser.cs
- TransformerInfo.cs
- ExpressionEditorAttribute.cs
- WinEventHandler.cs
- safesecurityhelperavalon.cs
- TabControl.cs
- PrefixHandle.cs
- Translator.cs
- assemblycache.cs
- DbXmlEnabledProviderManifest.cs
- UnsafeNativeMethods.cs
- BuildProviderAppliesToAttribute.cs
- TraceSource.cs
- ObjectQuery_EntitySqlExtensions.cs
- DataRecord.cs
- Vector3DCollectionValueSerializer.cs
- XPathNodeList.cs
- ModelTypeConverter.cs
- ReferencedAssemblyResolver.cs
- FeatureSupport.cs
- StateMachine.cs
- QueryableFilterRepeater.cs
- BitmapCodecInfo.cs
- ExternalException.cs
- XmlAnyElementAttribute.cs
- IdSpace.cs
- WebPartConnectionsCloseVerb.cs
- XPathDocument.cs
- Queue.cs
- KeySpline.cs
- ScriptResourceHandler.cs
- TableDetailsRow.cs
- ClockController.cs
- DataTableReaderListener.cs
- SiteMapSection.cs
- CodeTypeReferenceExpression.cs
- XmlFormatReaderGenerator.cs
- EventBookmark.cs
- WebPartsPersonalizationAuthorization.cs
- TextEvent.cs
- WindowsToolbarItemAsMenuItem.cs
- Debugger.cs
- ClientProxyGenerator.cs
- PrimaryKeyTypeConverter.cs
- TTSEngineTypes.cs
- WebScriptEndpoint.cs
- SafeRightsManagementHandle.cs
- ValueChangedEventManager.cs
- ConsumerConnectionPointCollection.cs
- NetworkInformationException.cs
- WebHostScriptMappingsInstallComponent.cs
- OracleFactory.cs
- LineServicesCallbacks.cs
- WindowsScroll.cs
- StylusSystemGestureEventArgs.cs
- PreviewKeyDownEventArgs.cs
- ConsoleTraceListener.cs
- Image.cs
- OptimalTextSource.cs
- COM2IDispatchConverter.cs
- UrlPath.cs
- SiteIdentityPermission.cs