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
- RelatedView.cs
- DomNameTable.cs
- XmlUTF8TextReader.cs
- RelatedView.cs
- BindingMemberInfo.cs
- ContractInferenceHelper.cs
- SmtpCommands.cs
- NewItemsContextMenuStrip.cs
- NameScopePropertyAttribute.cs
- StyleModeStack.cs
- ListBox.cs
- FormsAuthentication.cs
- MenuAutoFormat.cs
- TaiwanLunisolarCalendar.cs
- ListViewDesigner.cs
- DebugHandleTracker.cs
- BrushValueSerializer.cs
- ReferencedAssembly.cs
- ExpressionVisitor.cs
- DesignerSerializationOptionsAttribute.cs
- PageAsyncTaskManager.cs
- SimpleWorkerRequest.cs
- Emitter.cs
- DesignerHierarchicalDataSourceView.cs
- IncrementalReadDecoders.cs
- SamlSecurityToken.cs
- SelectionPatternIdentifiers.cs
- XsdValidatingReader.cs
- PassportAuthenticationModule.cs
- WebHttpDispatchOperationSelectorData.cs
- ProfileSettings.cs
- DataGridViewRowCollection.cs
- GlyphsSerializer.cs
- SecUtil.cs
- DataTablePropertyDescriptor.cs
- OletxVolatileEnlistment.cs
- AncestorChangedEventArgs.cs
- LogicalExpr.cs
- sqlmetadatafactory.cs
- RectangleHotSpot.cs
- MetadataItemEmitter.cs
- RawKeyboardInputReport.cs
- ImageAnimator.cs
- Not.cs
- ListItemDetailViewAttribute.cs
- BindingMAnagerBase.cs
- LexicalChunk.cs
- WindowsStreamSecurityBindingElement.cs
- UInt64Storage.cs
- EditingMode.cs
- ToolStripItemDataObject.cs
- Control.cs
- ObjectParameterCollection.cs
- XmlEncoding.cs
- Animatable.cs
- TableDetailsRow.cs
- GridItem.cs
- SetStateDesigner.cs
- OuterGlowBitmapEffect.cs
- ExecutionEngineException.cs
- UniqueIdentifierService.cs
- COMException.cs
- DataGridViewCellConverter.cs
- TheQuery.cs
- WebPartEditVerb.cs
- MenuEventArgs.cs
- OuterGlowBitmapEffect.cs
- SiteMapDataSourceDesigner.cs
- SchemaImporter.cs
- MediaElementAutomationPeer.cs
- HighContrastHelper.cs
- OrderToken.cs
- NavigatorOutput.cs
- QuadraticBezierSegment.cs
- WorkItem.cs
- XmlQualifiedNameTest.cs
- MarkupWriter.cs
- DataGridViewCellCollection.cs
- DelimitedListTraceListener.cs
- HttpPostClientProtocol.cs
- ClientUrlResolverWrapper.cs
- PageCache.cs
- SqlProfileProvider.cs
- WebContext.cs
- ColorBuilder.cs
- ServicePointManager.cs
- WebPartPersonalization.cs
- Binding.cs
- PocoPropertyAccessorStrategy.cs
- ResourceReferenceExpression.cs
- CriticalFileToken.cs
- Interlocked.cs
- MeasurementDCInfo.cs
- SessionEndingCancelEventArgs.cs
- OpCodes.cs
- SafeTimerHandle.cs
- TextAdaptor.cs
- AutomationIdentifierGuids.cs
- ToolZone.cs
- ExceptionHandlerDesigner.cs