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
- mediapermission.cs
- NetworkInformationException.cs
- WindowsContainer.cs
- BmpBitmapDecoder.cs
- DbParameterCollection.cs
- Control.cs
- ProxyGenerationError.cs
- LoginName.cs
- GeneratedContractType.cs
- messageonlyhwndwrapper.cs
- ZipQueryOperator.cs
- TypeConverter.cs
- RuntimeIdentifierPropertyAttribute.cs
- HtmlInputPassword.cs
- Pair.cs
- COM2ExtendedUITypeEditor.cs
- CacheHelper.cs
- xamlnodes.cs
- PreloadedPackages.cs
- CompilerResults.cs
- CategoryNameCollection.cs
- HttpPostedFile.cs
- Model3DGroup.cs
- InvariantComparer.cs
- Stack.cs
- MachineKeyConverter.cs
- MeasureItemEvent.cs
- CodeMethodInvokeExpression.cs
- TableCell.cs
- FaultDescriptionCollection.cs
- BinaryObjectReader.cs
- AuthorizationRuleCollection.cs
- HtmlTitle.cs
- LocalFileSettingsProvider.cs
- DbUpdateCommandTree.cs
- TextTrailingWordEllipsis.cs
- NativeMethods.cs
- SystemInformation.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- TypeExtensionSerializer.cs
- WindowsStatic.cs
- FunctionDescription.cs
- WebPart.cs
- CriticalFinalizerObject.cs
- InteropAutomationProvider.cs
- UrlParameterReader.cs
- ListViewInsertionMark.cs
- WebPartConnectionsConfigureVerb.cs
- TransformValueSerializer.cs
- DBBindings.cs
- TextDecorationUnitValidation.cs
- OleDbPermission.cs
- SystemException.cs
- WindowsGrip.cs
- PerformanceCounterPermission.cs
- ComplexPropertyEntry.cs
- webclient.cs
- DragEvent.cs
- TraceFilter.cs
- ReflectEventDescriptor.cs
- QueryStringParameter.cs
- FunctionQuery.cs
- AuthorizationRule.cs
- PrimitiveList.cs
- RawTextInputReport.cs
- RelationshipEndMember.cs
- TdsRecordBufferSetter.cs
- SamlSecurityTokenAuthenticator.cs
- GeneralTransform2DTo3D.cs
- XmlSchemaInferenceException.cs
- documentsequencetextpointer.cs
- Function.cs
- TreeNode.cs
- RoutedEventArgs.cs
- PLINQETWProvider.cs
- IndexerNameAttribute.cs
- TableRow.cs
- DefaultSettingsSection.cs
- RemotingException.cs
- LicenseManager.cs
- QilScopedVisitor.cs
- TableLayoutCellPaintEventArgs.cs
- DiagnosticTrace.cs
- NameValueFileSectionHandler.cs
- AliasedSlot.cs
- DataPagerFieldItem.cs
- HyperLinkDesigner.cs
- RemotingServices.cs
- ZipFileInfoCollection.cs
- DaylightTime.cs
- StylusEditingBehavior.cs
- LoginCancelEventArgs.cs
- BamlBinaryReader.cs
- CodeBinaryOperatorExpression.cs
- AssemblyAssociatedContentFileAttribute.cs
- Expr.cs
- ToolTipAutomationPeer.cs
- DBSqlParserTable.cs
- DataTableNewRowEvent.cs
- ToolboxBitmapAttribute.cs