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
- storepermissionattribute.cs
- RelationshipEndCollection.cs
- HttpWebRequestElement.cs
- WebConfigurationHostFileChange.cs
- Trace.cs
- CodeParameterDeclarationExpressionCollection.cs
- HttpCachePolicyWrapper.cs
- CasesDictionary.cs
- CodeDelegateInvokeExpression.cs
- DelegateBodyWriter.cs
- DataGridViewDataErrorEventArgs.cs
- TypedRowHandler.cs
- EncoderBestFitFallback.cs
- SqlDelegatedTransaction.cs
- NamedElement.cs
- DetailsView.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SpeakInfo.cs
- RewritingSimplifier.cs
- Pointer.cs
- CompositeDataBoundControl.cs
- DecimalConverter.cs
- TransformPattern.cs
- MessageContractMemberAttribute.cs
- CapabilitiesUse.cs
- BufferedGraphicsManager.cs
- ScriptControl.cs
- EmptyQuery.cs
- AssemblySettingAttributes.cs
- QueryGenerator.cs
- PermissionAttributes.cs
- ServiceDesigner.xaml.cs
- CompositeFontFamily.cs
- X509CertificateValidator.cs
- DataColumnMapping.cs
- WorkflowStateRollbackService.cs
- ReadWriteSpinLock.cs
- ItemsChangedEventArgs.cs
- Touch.cs
- NameNode.cs
- ImportedPolicyConversionContext.cs
- PTProvider.cs
- DataGridViewRowCancelEventArgs.cs
- MemberAssignmentAnalysis.cs
- Socket.cs
- TemplateNameScope.cs
- AnnotationService.cs
- xmlformatgeneratorstatics.cs
- Literal.cs
- PointConverter.cs
- ConvertersCollection.cs
- XPathCompileException.cs
- ConfigurationFileMap.cs
- Nodes.cs
- WorkflowInlining.cs
- MatrixTransform3D.cs
- StringCollection.cs
- NameNode.cs
- SmiContextFactory.cs
- RubberbandSelector.cs
- NativeMethodsOther.cs
- X500Name.cs
- CompositeScriptReferenceEventArgs.cs
- StylusPointPropertyUnit.cs
- CacheOutputQuery.cs
- DbDataRecord.cs
- SoapSchemaMember.cs
- XPathParser.cs
- UserControlBuildProvider.cs
- DbConnectionPoolCounters.cs
- WindowsRichEditRange.cs
- X509Extension.cs
- AsyncOperation.cs
- PackagingUtilities.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DataColumnMappingCollection.cs
- PropertyInfoSet.cs
- DataServiceResponse.cs
- TableLayoutRowStyleCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- DefaultDiscoveryService.cs
- XdrBuilder.cs
- UrlPropertyAttribute.cs
- CodeSnippetExpression.cs
- SHA512Cng.cs
- TypeSystem.cs
- SqlProviderManifest.cs
- CustomDictionarySources.cs
- ProfileEventArgs.cs
- DocComment.cs
- Utilities.cs
- PlatformCulture.cs
- CurrentTimeZone.cs
- FixedTextPointer.cs
- TargetException.cs
- ResXResourceSet.cs
- SqlUtils.cs
- TrustLevelCollection.cs
- HMACRIPEMD160.cs
- SimpleBitVector32.cs