Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / Update / Internal / ExtractedStateEntry.cs / 1 / 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, null /* indicates all properties are modified */); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, Enumerable.Empty() /* indicates no properties are modified */); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, Enumerable.Empty ()); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, stateEntry.GetModifiedProperties()); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, stateEntry.GetModifiedProperties()); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, null /* indicates all properties are modified */); 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, null /* indicates all properties are modified */); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, Enumerable.Empty() /* indicates no properties are modified */); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, Enumerable.Empty ()); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, stateEntry.GetModifiedProperties()); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, stateEntry.GetModifiedProperties()); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, null /* indicates all properties are modified */); 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
- ProtocolState.cs
- BaseTreeIterator.cs
- ImageCodecInfoPrivate.cs
- Aes.cs
- AppearanceEditorPart.cs
- UIElementParagraph.cs
- HttpClientCertificate.cs
- MoveSizeWinEventHandler.cs
- StorageTypeMapping.cs
- OpenFileDialog.cs
- StyleBamlTreeBuilder.cs
- XmlHierarchicalEnumerable.cs
- UniqueConstraint.cs
- ConstNode.cs
- HtmlInputPassword.cs
- TextReader.cs
- Array.cs
- OrderedDictionary.cs
- sqlnorm.cs
- BrushMappingModeValidation.cs
- DataServiceProviderMethods.cs
- PrivilegeNotHeldException.cs
- PlainXmlSerializer.cs
- EditorPartCollection.cs
- ServiceActivationException.cs
- WindowsScroll.cs
- DataGridViewAutoSizeModeEventArgs.cs
- TextEmbeddedObject.cs
- MaxMessageSizeStream.cs
- PenThreadPool.cs
- Debugger.cs
- lengthconverter.cs
- ImmutableDispatchRuntime.cs
- SqlRemoveConstantOrderBy.cs
- Permission.cs
- GridSplitter.cs
- Evaluator.cs
- Token.cs
- AccessDataSourceView.cs
- LicenseException.cs
- DataGridViewDataErrorEventArgs.cs
- ToolBar.cs
- DataKeyCollection.cs
- RetrieveVirtualItemEventArgs.cs
- ExpandSegmentCollection.cs
- WindowsStatic.cs
- RevocationPoint.cs
- SelectorItemAutomationPeer.cs
- SessionStateUtil.cs
- PropertyToken.cs
- MsmqTransportReceiveParameters.cs
- BindingRestrictions.cs
- TemplateControlParser.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- Point3DValueSerializer.cs
- hresults.cs
- CodeMemberProperty.cs
- BeginStoryboard.cs
- DiscoveryMessageSequence.cs
- AppDomainProtocolHandler.cs
- ArgIterator.cs
- _HelperAsyncResults.cs
- IndexedGlyphRun.cs
- validationstate.cs
- VScrollBar.cs
- NavigateEvent.cs
- TabControlCancelEvent.cs
- XmlUnspecifiedAttribute.cs
- BamlReader.cs
- RemoteWebConfigurationHost.cs
- userdatakeys.cs
- BindingOperations.cs
- FaultImportOptions.cs
- ProxyManager.cs
- PropertyTab.cs
- TextTreeInsertUndoUnit.cs
- XmlArrayItemAttributes.cs
- RecommendedAsConfigurableAttribute.cs
- HostingEnvironmentSection.cs
- VerificationException.cs
- serverconfig.cs
- EnumerableRowCollectionExtensions.cs
- RegexMatch.cs
- HtmlInputFile.cs
- SqlDuplicator.cs
- UnSafeCharBuffer.cs
- _WinHttpWebProxyDataBuilder.cs
- ImportCatalogPart.cs
- TreeBuilderBamlTranslator.cs
- TemplateControlParser.cs
- TypeBuilder.cs
- FragmentQueryProcessor.cs
- ItemsPresenter.cs
- diagnosticsswitches.cs
- PagerSettings.cs
- RouteCollection.cs
- ContractComponent.cs
- OperandQuery.cs
- AxisAngleRotation3D.cs
- PropertyBuilder.cs