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
- HttpListener.cs
- ProcessInfo.cs
- FileEnumerator.cs
- MoveSizeWinEventHandler.cs
- Size3D.cs
- AttributeAction.cs
- _SSPIWrapper.cs
- BaseCodePageEncoding.cs
- BuildProviderCollection.cs
- DataGridViewImageCell.cs
- ControlDesigner.cs
- StorageTypeMapping.cs
- ClockController.cs
- TemplateManager.cs
- TemplateColumn.cs
- SystemThemeKey.cs
- SocketElement.cs
- HostedHttpTransportManager.cs
- ConditionalExpression.cs
- DesignerRegionCollection.cs
- Hashtable.cs
- Math.cs
- SQLInt16.cs
- DocumentPageHost.cs
- ScriptResourceHandler.cs
- WindowsStartMenu.cs
- CryptoStream.cs
- SessionStateModule.cs
- HttpClientCertificate.cs
- XmlWhitespace.cs
- ProjectedWrapper.cs
- SaveRecipientRequest.cs
- MessageSecurityOverMsmqElement.cs
- WindowsListView.cs
- TextBoxDesigner.cs
- ContentOperations.cs
- ListenerElementsCollection.cs
- FastEncoder.cs
- OleDbTransaction.cs
- SqlReorderer.cs
- TableRowGroup.cs
- XmlWriter.cs
- XNodeSchemaApplier.cs
- FontUnitConverter.cs
- Msec.cs
- ConditionCollection.cs
- DispatchWrapper.cs
- ReliableMessagingHelpers.cs
- Tuple.cs
- AuthenticationSection.cs
- SafeRightsManagementSessionHandle.cs
- BitmapFrameEncode.cs
- Visual3DCollection.cs
- WebServiceReceiveDesigner.cs
- WebControlsSection.cs
- CustomServiceCredentials.cs
- ToolStripContentPanelDesigner.cs
- SingleObjectCollection.cs
- ToolStripItemImageRenderEventArgs.cs
- InputGestureCollection.cs
- SingleSelectRootGridEntry.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- MetadataArtifactLoaderComposite.cs
- CommentEmitter.cs
- XamlStyleSerializer.cs
- FontEditor.cs
- MembershipSection.cs
- TextBoxLine.cs
- PromptEventArgs.cs
- IntegerValidator.cs
- ServicePoint.cs
- TypedTableHandler.cs
- RegexWriter.cs
- ItemsChangedEventArgs.cs
- OdbcParameter.cs
- CreateParams.cs
- KeyFrames.cs
- DebugHandleTracker.cs
- UIElementIsland.cs
- DBPropSet.cs
- LinqDataSourceInsertEventArgs.cs
- LayoutTableCell.cs
- SecondaryIndexList.cs
- SspiWrapper.cs
- Grant.cs
- OptimizedTemplateContentHelper.cs
- MetadataPropertyCollection.cs
- _CacheStreams.cs
- BlurEffect.cs
- BaseConfigurationRecord.cs
- VisualTarget.cs
- DataGridViewAutoSizeModeEventArgs.cs
- CodeIterationStatement.cs
- IConvertible.cs
- ScrollData.cs
- FilterQueryOptionExpression.cs
- BamlBinaryWriter.cs
- MatrixValueSerializer.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- MappingItemCollection.cs