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
- MethodRental.cs
- Header.cs
- Int16KeyFrameCollection.cs
- BCLDebug.cs
- TextElementEnumerator.cs
- PagesSection.cs
- AssemblySettingAttributes.cs
- ProviderUtil.cs
- GraphicsContext.cs
- UnsafeNativeMethods.cs
- Message.cs
- TableLayoutStyle.cs
- ScriptIgnoreAttribute.cs
- CommentEmitter.cs
- SectionXmlInfo.cs
- IteratorFilter.cs
- IdentityModelDictionary.cs
- Merger.cs
- TextHidden.cs
- AutomationEventArgs.cs
- BigInt.cs
- FigureParagraph.cs
- XmlSerializer.cs
- FontCollection.cs
- CryptoKeySecurity.cs
- Debugger.cs
- WebPartConnectionsConnectVerb.cs
- _ProxyChain.cs
- PagesChangedEventArgs.cs
- FontSizeConverter.cs
- WebPartDisplayModeCancelEventArgs.cs
- CodeTypeParameter.cs
- RelationshipManager.cs
- StringAttributeCollection.cs
- DefaultParameterValueAttribute.cs
- DetailsViewDesigner.cs
- VersionPair.cs
- Span.cs
- FixedPageAutomationPeer.cs
- KeyedHashAlgorithm.cs
- _OverlappedAsyncResult.cs
- OdbcCommandBuilder.cs
- App.cs
- sqlstateclientmanager.cs
- DataGridViewCellStyleConverter.cs
- DefaultTextStore.cs
- OutputCacheModule.cs
- TriggerCollection.cs
- HtmlInputCheckBox.cs
- OpenTypeMethods.cs
- PropertyPath.cs
- GlyphInfoList.cs
- LayoutManager.cs
- HighlightVisual.cs
- ErrorHandler.cs
- BezierSegment.cs
- ObjectStateFormatter.cs
- ReturnType.cs
- PartitionedStream.cs
- LoadGrammarCompletedEventArgs.cs
- NullRuntimeConfig.cs
- TemplateBuilder.cs
- SimpleBitVector32.cs
- FlowThrottle.cs
- CodeTypeOfExpression.cs
- IxmlLineInfo.cs
- CanExecuteRoutedEventArgs.cs
- ListView.cs
- EncoderBestFitFallback.cs
- UniqueEventHelper.cs
- FontNamesConverter.cs
- ValidatorCompatibilityHelper.cs
- RouteItem.cs
- PasswordRecoveryAutoFormat.cs
- QilGeneratorEnv.cs
- XPathItem.cs
- Literal.cs
- OutputCacheEntry.cs
- DocComment.cs
- HttpHandlersSection.cs
- SystemEvents.cs
- XhtmlTextWriter.cs
- EntityClassGenerator.cs
- BaseAsyncResult.cs
- MenuItemStyle.cs
- DataServiceCollectionOfT.cs
- DataGridViewControlCollection.cs
- SQLDouble.cs
- MailAddress.cs
- SyncOperationState.cs
- TextAutomationPeer.cs
- DispatchProxy.cs
- MDIControlStrip.cs
- CalculatedColumn.cs
- GroupBox.cs
- PartManifestEntry.cs
- KeyedCollection.cs
- X509LogoTypeExtension.cs
- MailBnfHelper.cs
- DocumentAutomationPeer.cs