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
- JournalEntryListConverter.cs
- ThreadInterruptedException.cs
- ButtonField.cs
- Vector3D.cs
- TextTreeFixupNode.cs
- AspNetRouteServiceHttpHandler.cs
- _AutoWebProxyScriptHelper.cs
- UriTemplateCompoundPathSegment.cs
- XslTransformFileEditor.cs
- InfoCardProofToken.cs
- ImmutableObjectAttribute.cs
- OdbcException.cs
- SerializationSectionGroup.cs
- ImageBrush.cs
- TextElement.cs
- TryExpression.cs
- FlowLayoutPanel.cs
- TerminatorSinks.cs
- TCPListener.cs
- SoapExtensionReflector.cs
- LinkLabelLinkClickedEvent.cs
- EdmComplexTypeAttribute.cs
- ComponentResourceManager.cs
- LicenseException.cs
- _TimerThread.cs
- AsymmetricKeyExchangeFormatter.cs
- LineServices.cs
- EditCommandColumn.cs
- WebPartMenuStyle.cs
- CharacterMetricsDictionary.cs
- ProviderMetadata.cs
- StatusBarDesigner.cs
- HtmlImage.cs
- BamlStream.cs
- _LocalDataStore.cs
- _OSSOCK.cs
- SourceElementsCollection.cs
- GradientBrush.cs
- WebPartManagerInternals.cs
- GraphicsPathIterator.cs
- PropertyMappingExceptionEventArgs.cs
- ProfilePropertySettings.cs
- UserNameSecurityTokenAuthenticator.cs
- HandleCollector.cs
- ADRole.cs
- RuntimeTrackingProfile.cs
- ParameterCollection.cs
- ObjectSelectorEditor.cs
- DataGridViewToolTip.cs
- CacheDependency.cs
- Table.cs
- TypeConverters.cs
- CodeNamespaceImportCollection.cs
- InheritanceUI.cs
- UIElementParagraph.cs
- WebConfigurationManager.cs
- PeerName.cs
- ListControlActionList.cs
- ActivationArguments.cs
- GlyphShapingProperties.cs
- SystemIcons.cs
- MailMessage.cs
- PrinterUnitConvert.cs
- FunctionDescription.cs
- LinqDataSourceInsertEventArgs.cs
- XmlUtil.cs
- DbMetaDataColumnNames.cs
- Script.cs
- CorrelationKeyCalculator.cs
- Listbox.cs
- Repeater.cs
- CategoryAttribute.cs
- InstancePersistenceContext.cs
- PageCodeDomTreeGenerator.cs
- listitem.cs
- RenderCapability.cs
- EmptyCollection.cs
- FieldCollectionEditor.cs
- DrawingBrush.cs
- ModelItem.cs
- RootBrowserWindowProxy.cs
- FormViewDeleteEventArgs.cs
- EndOfStreamException.cs
- CriticalExceptions.cs
- XmlSchemaSimpleContentExtension.cs
- ObjRef.cs
- ComponentCommands.cs
- UnitySerializationHolder.cs
- Style.cs
- SmiContextFactory.cs
- RadioButton.cs
- WebDisplayNameAttribute.cs
- ToolStripMenuItemCodeDomSerializer.cs
- XsdBuilder.cs
- WebPartCatalogCloseVerb.cs
- WebGetAttribute.cs
- RoutedEvent.cs
- DataControlPagerLinkButton.cs
- BaseCodeDomTreeGenerator.cs
- SystemIcons.cs