Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / DataClasses / RelationshipFixer.cs / 1305376 / 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 where TTargetEntity : class { // 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 where TTargetEntity : class { // 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
- IndexedSelectQueryOperator.cs
- DBSqlParserTable.cs
- ObjectTag.cs
- IUnknownConstantAttribute.cs
- EdmFunction.cs
- WindowAutomationPeer.cs
- PointValueSerializer.cs
- RtType.cs
- PointAnimationClockResource.cs
- NodeLabelEditEvent.cs
- COM2ExtendedUITypeEditor.cs
- GuidConverter.cs
- UniqueIdentifierService.cs
- HttpHandlersSection.cs
- HttpWebRequestElement.cs
- MembershipUser.cs
- PropertyDescriptorComparer.cs
- OverlappedContext.cs
- KernelTypeValidation.cs
- ControlIdConverter.cs
- XmlAttributeProperties.cs
- WindowsGraphicsCacheManager.cs
- DataControlFieldCell.cs
- NextPreviousPagerField.cs
- SoapFault.cs
- XmlSchemaValidationException.cs
- RequestChannelBinder.cs
- HtmlElementCollection.cs
- ResXDataNode.cs
- BaseDataList.cs
- CompiledRegexRunnerFactory.cs
- RoutedEventHandlerInfo.cs
- filewebresponse.cs
- WebPartConnectionsConnectVerb.cs
- XmlSigningNodeWriter.cs
- ContainerUIElement3D.cs
- RegularExpressionValidator.cs
- HtmlElementEventArgs.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ContentElementAutomationPeer.cs
- Group.cs
- ButtonChrome.cs
- AppModelKnownContentFactory.cs
- XmlSchemaComplexContentExtension.cs
- DbBuffer.cs
- DtrList.cs
- RoleGroupCollection.cs
- NamespaceList.cs
- DeviceFilterEditorDialog.cs
- PtsCache.cs
- ResourceIDHelper.cs
- WaitForChangedResult.cs
- ContentValidator.cs
- CodeGotoStatement.cs
- ConfigPathUtility.cs
- FixedElement.cs
- EventLogPermission.cs
- CookielessHelper.cs
- Track.cs
- ContentPosition.cs
- ExpressionConverter.cs
- TableRowGroup.cs
- GroupJoinQueryOperator.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- WorkflowApplicationUnloadedException.cs
- WorkflowApplicationAbortedEventArgs.cs
- AdornerPresentationContext.cs
- PolicyManager.cs
- ProxyAttribute.cs
- SequenceDesigner.cs
- LogWriteRestartAreaAsyncResult.cs
- SetState.cs
- IssuanceLicense.cs
- AQNBuilder.cs
- BindingRestrictions.cs
- WebColorConverter.cs
- WorkflowMessageEventArgs.cs
- TextMessageEncoder.cs
- OwnerDrawPropertyBag.cs
- WindowVisualStateTracker.cs
- TraceShell.cs
- OleDragDropHandler.cs
- ScrollChrome.cs
- HtmlTitle.cs
- XPathDocumentNavigator.cs
- ExceptionUtil.cs
- SpecialFolderEnumConverter.cs
- SqlParameterizer.cs
- ServiceThrottlingElement.cs
- SelectionWordBreaker.cs
- EncoderParameters.cs
- TableRowCollection.cs
- ServiceDeploymentInfo.cs
- WebScriptEnablingElement.cs
- PowerStatus.cs
- AutomationElement.cs
- SaveFileDialogDesigner.cs
- CmsUtils.cs
- TimerElapsedEvenArgs.cs
- StaticTextPointer.cs