Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Objects / DataClasses / RelationshipFixer.cs / 2 / RelationshipFixer.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
namespace System.Data.Objects.DataClasses
{
[Serializable]
internal class RelationshipFixer : IRelationshipFixer
where TSourceEntity : class, IEntityWithRelationships
where TTargetEntity : class, IEntityWithRelationships
{
// The following fields are serialized. Adding or removing a serialized field is considered
// a breaking change. This includes changing the field type or field name of existing
// serialized fields. If you need to make this kind of change, it may be possible, but it
// will require some custom serialization/deserialization code.
RelationshipMultiplicity _sourceRoleMultiplicity;
RelationshipMultiplicity _targetRoleMultiplicity;
internal RelationshipFixer(RelationshipMultiplicity sourceRoleMultiplicity, RelationshipMultiplicity targetRoleMultiplicity)
{
_sourceRoleMultiplicity = sourceRoleMultiplicity;
_targetRoleMultiplicity = targetRoleMultiplicity;
}
///
/// Used during relationship fixup when the source end of the relationship is not
/// yet in the relationships list, and needs to be created
///
/// RelationshipNavigation to be set on new RelatedEnd
/// RelationshipManager to use for creating the new end
/// Reference to the new collection or reference on the other end of the relationship
RelatedEnd IRelationshipFixer.CreateSourceEnd(RelationshipNavigation navigation, RelationshipManager relationshipManager)
{
return relationshipManager.CreateRelatedEnd(navigation, _targetRoleMultiplicity, _sourceRoleMultiplicity, /*existingRelatedEnd*/ null);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Metadata.Edm;
namespace System.Data.Objects.DataClasses
{
[Serializable]
internal class RelationshipFixer : IRelationshipFixer
where TSourceEntity : class, IEntityWithRelationships
where TTargetEntity : class, IEntityWithRelationships
{
// The following fields are serialized. Adding or removing a serialized field is considered
// a breaking change. This includes changing the field type or field name of existing
// serialized fields. If you need to make this kind of change, it may be possible, but it
// will require some custom serialization/deserialization code.
RelationshipMultiplicity _sourceRoleMultiplicity;
RelationshipMultiplicity _targetRoleMultiplicity;
internal RelationshipFixer(RelationshipMultiplicity sourceRoleMultiplicity, RelationshipMultiplicity targetRoleMultiplicity)
{
_sourceRoleMultiplicity = sourceRoleMultiplicity;
_targetRoleMultiplicity = targetRoleMultiplicity;
}
///
/// Used during relationship fixup when the source end of the relationship is not
/// yet in the relationships list, and needs to be created
///
/// RelationshipNavigation to be set on new RelatedEnd
/// RelationshipManager to use for creating the new end
/// Reference to the new collection or reference on the other end of the relationship
RelatedEnd IRelationshipFixer.CreateSourceEnd(RelationshipNavigation navigation, RelationshipManager relationshipManager)
{
return relationshipManager.CreateRelatedEnd(navigation, _targetRoleMultiplicity, _sourceRoleMultiplicity, /*existingRelatedEnd*/ null);
}
}
}
// 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
- UserControlBuildProvider.cs
- _SecureChannel.cs
- XmlCustomFormatter.cs
- ContextProperty.cs
- SizeConverter.cs
- Image.cs
- ConsoleCancelEventArgs.cs
- RemotingAttributes.cs
- DesignerTransactionCloseEvent.cs
- CodeParameterDeclarationExpressionCollection.cs
- ParallelDesigner.cs
- BitmapEffectGroup.cs
- filewebrequest.cs
- ListItemCollection.cs
- Light.cs
- Subset.cs
- WebUtil.cs
- CodeTypeMemberCollection.cs
- DebugController.cs
- DelegatingConfigHost.cs
- CatalogPartCollection.cs
- JsonReaderWriterFactory.cs
- DataSet.cs
- StyleReferenceConverter.cs
- SimpleTextLine.cs
- BaseValidator.cs
- SourceInterpreter.cs
- SByteStorage.cs
- ColumnResult.cs
- ExecutorLocksHeldException.cs
- Style.cs
- SourceSwitch.cs
- QuaternionAnimationBase.cs
- ProtectedUri.cs
- AdRotator.cs
- Subtree.cs
- ServiceDescriptions.cs
- TransactionProtocol.cs
- GlyphRun.cs
- PathTooLongException.cs
- DesignTimeParseData.cs
- ReceiveDesigner.xaml.cs
- NullableBoolConverter.cs
- ObjectTypeMapping.cs
- TextRangeProviderWrapper.cs
- StoreItemCollection.cs
- Authorization.cs
- HttpHeaderCollection.cs
- DatePicker.cs
- CodeSnippetTypeMember.cs
- XsltArgumentList.cs
- SHA1.cs
- MbpInfo.cs
- CheckedListBox.cs
- PersonalizationStateQuery.cs
- PageBuildProvider.cs
- SerializationSectionGroup.cs
- CompilerError.cs
- TableFieldsEditor.cs
- TypeUsageBuilder.cs
- MailMessageEventArgs.cs
- SqlCrossApplyToCrossJoin.cs
- HttpCapabilitiesEvaluator.cs
- MultipleViewProviderWrapper.cs
- EditorPartChrome.cs
- RightsManagementEncryptionTransform.cs
- DescriptionAttribute.cs
- InteropBitmapSource.cs
- SmiSettersStream.cs
- InkCollectionBehavior.cs
- WindowsScrollBarBits.cs
- TemplateAction.cs
- AttributeEmitter.cs
- DbExpressionBuilder.cs
- TimeoutValidationAttribute.cs
- Source.cs
- RadioButtonList.cs
- MessageBox.cs
- DbDataRecord.cs
- ConfigurationStrings.cs
- SqlUDTStorage.cs
- PnrpPermission.cs
- ServiceXNameTypeConverter.cs
- SmtpDigestAuthenticationModule.cs
- newinstructionaction.cs
- ConfigurationValidatorAttribute.cs
- InstanceLockedException.cs
- InternalMappingException.cs
- CustomErrorCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- DispatcherTimer.cs
- MenuAutoFormat.cs
- DescendentsWalkerBase.cs
- DataGridViewRowsRemovedEventArgs.cs
- Type.cs
- EntityDataSourceUtil.cs
- TypeSource.cs
- XmlWrappingWriter.cs
- MetricEntry.cs
- InkCanvasFeedbackAdorner.cs