Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / Update / Internal / ExtractedStateEntry.cs / 1305376 / ExtractedStateEntry.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Data.Metadata.Edm; using System.Diagnostics; using System.Linq; namespace System.Data.Mapping.Update.Internal { ////// Represents the data contained in a StateEntry using internal data structures /// of the UpdatePipeline. /// internal struct ExtractedStateEntry { internal readonly EntityState State; internal readonly PropagatorResult Original; internal readonly PropagatorResult Current; internal readonly IEntityStateEntry Source; internal ExtractedStateEntry(UpdateTranslator translator, IEntityStateEntry stateEntry) { Debug.Assert(null != stateEntry, "stateEntry must not be null"); this.State = stateEntry.State; this.Source = stateEntry; switch (stateEntry.State) { case EntityState.Deleted: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); break; default: Debug.Fail("unexpected IEntityStateEntry.State for entity " + stateEntry.State); this.Original = null; this.Current = null; break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Data.Metadata.Edm; using System.Diagnostics; using System.Linq; namespace System.Data.Mapping.Update.Internal { ////// Represents the data contained in a StateEntry using internal data structures /// of the UpdatePipeline. /// internal struct ExtractedStateEntry { internal readonly EntityState State; internal readonly PropagatorResult Original; internal readonly PropagatorResult Current; internal readonly IEntityStateEntry Source; internal ExtractedStateEntry(UpdateTranslator translator, IEntityStateEntry stateEntry) { Debug.Assert(null != stateEntry, "stateEntry must not be null"); this.State = stateEntry.State; this.Source = stateEntry; switch (stateEntry.State) { case EntityState.Deleted: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); break; default: Debug.Fail("unexpected IEntityStateEntry.State for entity " + stateEntry.State); this.Original = null; this.Current = null; break; } } } } // 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
- SupportsEventValidationAttribute.cs
- SvcFileManager.cs
- FlowDocumentFormatter.cs
- ReferenceEqualityComparer.cs
- SafeThemeHandle.cs
- Rfc4050KeyFormatter.cs
- ExtenderControl.cs
- WebPartUtil.cs
- TextDecoration.cs
- UIAgentAsyncBeginRequest.cs
- IDQuery.cs
- ToolStripSplitButton.cs
- webclient.cs
- __Error.cs
- SrgsGrammar.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XomlCompilerError.cs
- ObjectHelper.cs
- ConfigXmlText.cs
- ValidationVisibilityAttribute.cs
- PixelFormatConverter.cs
- ToggleButtonAutomationPeer.cs
- XPathItem.cs
- AncillaryOps.cs
- CryptoHelper.cs
- CommonProperties.cs
- Exceptions.cs
- ConditionChanges.cs
- SystemUnicastIPAddressInformation.cs
- WindowsToolbarAsMenu.cs
- MatrixTransform3D.cs
- SerializationSectionGroup.cs
- InstanceOwnerQueryResult.cs
- UIAgentCrashedException.cs
- SafeNativeMethods.cs
- ControlPropertyNameConverter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ActionItem.cs
- WebContext.cs
- WebBrowserSiteBase.cs
- Barrier.cs
- MetadataItemSerializer.cs
- ControlAdapter.cs
- AttachedPropertyBrowsableAttribute.cs
- ObjectView.cs
- GC.cs
- FontStretches.cs
- CalendarSelectionChangedEventArgs.cs
- Config.cs
- BuildProviderCollection.cs
- shaperfactoryquerycacheentry.cs
- TabItemAutomationPeer.cs
- SourceChangedEventArgs.cs
- NodeLabelEditEvent.cs
- WindowCollection.cs
- ProfilePropertyNameValidator.cs
- X509CertificateValidator.cs
- XmlDeclaration.cs
- RelatedPropertyManager.cs
- Keywords.cs
- XmlSchemaSubstitutionGroup.cs
- AnimationLayer.cs
- CannotUnloadAppDomainException.cs
- Control.cs
- AdditionalEntityFunctions.cs
- SqlClientMetaDataCollectionNames.cs
- BitArray.cs
- TableCellsCollectionEditor.cs
- ListControlActionList.cs
- TrackingAnnotationCollection.cs
- ConnectionsZone.cs
- BaseAddressPrefixFilterElementCollection.cs
- CodeTypeConstructor.cs
- Mouse.cs
- UnsafeNativeMethodsCLR.cs
- XmlNamedNodeMap.cs
- FormsAuthenticationUserCollection.cs
- CurrentChangingEventArgs.cs
- FieldNameLookup.cs
- FormCollection.cs
- TypeConverterHelper.cs
- PhysicalOps.cs
- EpmAttributeNameBuilder.cs
- MULTI_QI.cs
- HtmlLabelAdapter.cs
- FloaterBaseParagraph.cs
- TextTreeUndo.cs
- Point4D.cs
- GridViewCancelEditEventArgs.cs
- ExpressionBuilderContext.cs
- CompensatableSequenceActivity.cs
- HtmlShimManager.cs
- HtmlWindow.cs
- DataAccessor.cs
- XmlHierarchicalDataSourceView.cs
- MatrixValueSerializer.cs
- WebEvents.cs
- Matrix3D.cs
- GridLength.cs
- SafeHandles.cs