Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Encoding.cs
- Int64.cs
- PropertyChangedEventArgs.cs
- MissingMemberException.cs
- Size.cs
- UserNamePasswordValidator.cs
- Base64Stream.cs
- Point4D.cs
- RoleBoolean.cs
- DesignerHost.cs
- SqlAliasesReferenced.cs
- APCustomTypeDescriptor.cs
- UnmanagedMarshal.cs
- ProtocolsConfiguration.cs
- TableLayoutSettings.cs
- MailAddressCollection.cs
- ActivationArguments.cs
- FormViewInsertEventArgs.cs
- CompletionBookmark.cs
- TemplateBamlTreeBuilder.cs
- PlanCompilerUtil.cs
- FaultHandlingFilter.cs
- RowToParametersTransformer.cs
- RegexWorker.cs
- EventManager.cs
- ScriptingProfileServiceSection.cs
- SchemaImporterExtension.cs
- TabItemAutomationPeer.cs
- SoapObjectInfo.cs
- RowsCopiedEventArgs.cs
- Transform3DCollection.cs
- RunWorkerCompletedEventArgs.cs
- ManagementNamedValueCollection.cs
- WebPartDisplayModeEventArgs.cs
- _SSPIWrapper.cs
- InvalidTimeZoneException.cs
- DelegatingTypeDescriptionProvider.cs
- BCLDebug.cs
- CapiHashAlgorithm.cs
- ProcessMonitor.cs
- AutomationProperty.cs
- SelectedDatesCollection.cs
- HelloMessageApril2005.cs
- FormViewModeEventArgs.cs
- WorkflowApplicationCompletedException.cs
- DeviceContexts.cs
- SecurityException.cs
- OrderedDictionary.cs
- Splitter.cs
- XmlSchemaFacet.cs
- SqlCacheDependencyDatabaseCollection.cs
- StrokeSerializer.cs
- LogRecordSequence.cs
- WindowPattern.cs
- ApplicationException.cs
- ListViewTableRow.cs
- DateBoldEvent.cs
- SqlErrorCollection.cs
- TextTreeUndo.cs
- InfocardExtendedInformationCollection.cs
- DynamicMethod.cs
- GridViewAutomationPeer.cs
- SettingsPropertyValue.cs
- ConnectionPoolManager.cs
- GridViewUpdatedEventArgs.cs
- ControlBuilder.cs
- MulticastDelegate.cs
- OrderByLifter.cs
- LiteralSubsegment.cs
- AnnotationAdorner.cs
- WeakEventTable.cs
- PathFigureCollection.cs
- XsdDuration.cs
- MSAAWinEventWrap.cs
- PagerSettings.cs
- QueryConverter.cs
- FontUnit.cs
- ProcessThread.cs
- DictionaryEntry.cs
- HandleCollector.cs
- EntityException.cs
- CodeSubDirectory.cs
- IdnElement.cs
- XmlSequenceWriter.cs
- LocationUpdates.cs
- SizeF.cs
- IBuiltInEvidence.cs
- NativeMethodsCLR.cs
- WebPartCloseVerb.cs
- TableProviderWrapper.cs
- WindowsProgressbar.cs
- StringResourceManager.cs
- OrCondition.cs
- IgnoreSection.cs
- UserControlCodeDomTreeGenerator.cs
- DelegateHelpers.Generated.cs
- UserNameSecurityTokenParameters.cs
- AlternateView.cs
- DeclarationUpdate.cs
- RelationshipConstraintValidator.cs