Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / ObjectStateEntryDbUpdatableDataRecord.cs / 1305376 / ObjectStateEntryDbUpdatableDataRecord.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.ComponentModel; using System.Data; using System.Data.Common; using System.Data.Metadata.Edm; using System.Data.Objects; using System.Diagnostics; using System.Reflection; namespace System.Data.Objects { internal sealed class ObjectStateEntryDbUpdatableDataRecord : CurrentValueRecord { internal ObjectStateEntryDbUpdatableDataRecord(EntityEntry cacheEntry, StateManagerTypeMetadata metadata, object userObject) : base(cacheEntry, metadata, userObject) { EntityUtil.CheckArgumentNull(cacheEntry, "cacheEntry"); EntityUtil.CheckArgumentNull(userObject, "userObject"); EntityUtil.CheckArgumentNull(metadata, "metadata"); Debug.Assert(!cacheEntry.IsKeyEntry, "Cannot create an ObjectStateEntryDbUpdatableDataRecord for a key entry"); switch (cacheEntry.State) { case EntityState.Unchanged: case EntityState.Modified: case EntityState.Added: break; default: Debug.Assert(false, "A CurrentValueRecord cannot be created for an entity object that is in a deleted or detached state."); break; } } internal ObjectStateEntryDbUpdatableDataRecord(RelationshipEntry cacheEntry) : base(cacheEntry) { EntityUtil.CheckArgumentNull(cacheEntry, "cacheEntry"); switch (cacheEntry.State) { case EntityState.Unchanged: case EntityState.Modified: case EntityState.Added: break; default: Debug.Assert(false, "A CurrentValueRecord cannot be created for an entity object that is in a deleted or detached state."); break; } } protected override object GetRecordValue(int ordinal) { if (_cacheEntry.IsRelationship) { return (_cacheEntry as RelationshipEntry).GetCurrentRelationValue(ordinal); } else { return (_cacheEntry as EntityEntry).GetCurrentEntityValue(_metadata, ordinal, _userObject, ObjectStateValueRecord.CurrentUpdatable); } } protected override void SetRecordValue(int ordinal, object value) { if (_cacheEntry.IsRelationship) { // Cannot modify relation values from the public API throw EntityUtil.CantModifyRelationValues(); } else { (_cacheEntry as EntityEntry).SetCurrentEntityValue(_metadata, ordinal, _userObject, value); } } } } // 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
- ModuleConfigurationInfo.cs
- DuplicateWaitObjectException.cs
- RecognizeCompletedEventArgs.cs
- InternalConfigRoot.cs
- BinaryConverter.cs
- DesignBindingPicker.cs
- ProfileInfo.cs
- DataSourceNameHandler.cs
- _StreamFramer.cs
- SerializationEventsCache.cs
- BindingsCollection.cs
- HostedNamedPipeTransportManager.cs
- XPathPatternParser.cs
- DrawingAttributeSerializer.cs
- CustomSignedXml.cs
- NameValuePair.cs
- XmlCountingReader.cs
- MarkupCompilePass2.cs
- XmlNullResolver.cs
- HwndSourceParameters.cs
- IgnoreFileBuildProvider.cs
- NavigationExpr.cs
- ByteArrayHelperWithString.cs
- HtmlMeta.cs
- LockedBorderGlyph.cs
- AccessDataSourceWizardForm.cs
- RectConverter.cs
- SafeFileHandle.cs
- QilIterator.cs
- COAUTHINFO.cs
- ErrorTableItemStyle.cs
- CheckoutException.cs
- SimpleHandlerFactory.cs
- ReaderWriterLockWrapper.cs
- BitmapMetadataBlob.cs
- SelectionUIHandler.cs
- RotationValidation.cs
- InheritanceService.cs
- JsonFormatGeneratorStatics.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XamlWriter.cs
- SystemWebExtensionsSectionGroup.cs
- SortFieldComparer.cs
- JsonMessageEncoderFactory.cs
- SmtpClient.cs
- TitleStyle.cs
- Page.cs
- _CacheStreams.cs
- EntityConnectionStringBuilder.cs
- WinInetCache.cs
- ContainerSelectorActiveEvent.cs
- Baml2006ReaderSettings.cs
- WebConfigurationHostFileChange.cs
- XomlCompilerError.cs
- Decorator.cs
- Variant.cs
- RegisteredDisposeScript.cs
- _SslSessionsCache.cs
- OlePropertyStructs.cs
- ListItemCollection.cs
- UserUseLicenseDictionaryLoader.cs
- AsyncDataRequest.cs
- Subtree.cs
- UrlAuthFailedErrorFormatter.cs
- RTTypeWrapper.cs
- TemplatePagerField.cs
- AssemblyUtil.cs
- XmlAttributeCollection.cs
- TrailingSpaceComparer.cs
- RectIndependentAnimationStorage.cs
- MTConfigUtil.cs
- SingleAnimationUsingKeyFrames.cs
- DispatcherProcessingDisabled.cs
- TimelineGroup.cs
- Menu.cs
- SecurityTokenException.cs
- IdnElement.cs
- WebPartMenuStyle.cs
- ApplicationProxyInternal.cs
- AVElementHelper.cs
- InvalidCommandTreeException.cs
- SqlDataSourceConfigureSelectPanel.cs
- ButtonChrome.cs
- ReachSerializationUtils.cs
- WebPartDisplayMode.cs
- DataPointer.cs
- IDQuery.cs
- EntityDataSourceContainerNameConverter.cs
- PieceDirectory.cs
- VisualStyleElement.cs
- OleDbException.cs
- SqlCharStream.cs
- RectangleF.cs
- BinaryReader.cs
- KeysConverter.cs
- PhotoPrintingIntent.cs
- ArrangedElement.cs
- XPathNode.cs
- LayoutEvent.cs
- ZipPackage.cs