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
- InvokeMethodActivity.cs
- IISUnsafeMethods.cs
- SecurityTokenAuthenticator.cs
- UnconditionalPolicy.cs
- Pkcs9Attribute.cs
- SamlDelegatingWriter.cs
- EnumConverter.cs
- UriScheme.cs
- TextTabProperties.cs
- DispatcherTimer.cs
- XmlEntityReference.cs
- MenuAdapter.cs
- externdll.cs
- RectangleGeometry.cs
- TemplateBamlTreeBuilder.cs
- DataGridViewComponentPropertyGridSite.cs
- TrackingMemoryStream.cs
- ProfileProvider.cs
- MDIControlStrip.cs
- InplaceBitmapMetadataWriter.cs
- XPathNodeInfoAtom.cs
- TraceListeners.cs
- ValidatingPropertiesEventArgs.cs
- VisualStyleInformation.cs
- ValueTable.cs
- SpinWait.cs
- FileSystemInfo.cs
- GeneralTransform.cs
- FrameworkPropertyMetadata.cs
- Function.cs
- MeasureItemEvent.cs
- DataTableReaderListener.cs
- OleDbSchemaGuid.cs
- InternalTypeHelper.cs
- DataSourceHelper.cs
- AnnotationDocumentPaginator.cs
- InputChannelAcceptor.cs
- IdentityReference.cs
- CultureData.cs
- PrtCap_Public_Simple.cs
- FlowPosition.cs
- StylusPlugin.cs
- DataGrid.cs
- AppModelKnownContentFactory.cs
- SQLDecimal.cs
- QuinticEase.cs
- Rotation3DAnimationBase.cs
- XmlReturnWriter.cs
- LogicalTreeHelper.cs
- SoapIncludeAttribute.cs
- NameTable.cs
- Site.cs
- _AuthenticationState.cs
- GroupByExpressionRewriter.cs
- RuntimeIdentifierPropertyAttribute.cs
- CaseCqlBlock.cs
- DmlSqlGenerator.cs
- EmptyEnumerator.cs
- VirtualizingPanel.cs
- TemplateControl.cs
- StylusDownEventArgs.cs
- Link.cs
- ListBoxItem.cs
- ProviderConnectionPoint.cs
- ArrayExtension.cs
- HttpProfileBase.cs
- MobileControlBuilder.cs
- PrimarySelectionAdorner.cs
- TrustSection.cs
- ProfessionalColors.cs
- SQLInt64Storage.cs
- ToolboxComponentsCreatingEventArgs.cs
- Currency.cs
- BufferAllocator.cs
- WebPartZoneAutoFormat.cs
- AssociationSet.cs
- WorkflowMarkupSerializerMapping.cs
- HtmlUtf8RawTextWriter.cs
- TreeNodeStyleCollection.cs
- XmlUnspecifiedAttribute.cs
- VersionedStreamOwner.cs
- SharedStatics.cs
- CompilationUnit.cs
- Pair.cs
- ScrollViewer.cs
- HelpPage.cs
- UserMapPath.cs
- TraceSwitch.cs
- BindingExpression.cs
- WindowsTitleBar.cs
- SqlConnectionStringBuilder.cs
- CodeTypeDelegate.cs
- QuerySubExprEliminator.cs
- ConfigurationStrings.cs
- CustomError.cs
- UnsafeNativeMethods.cs
- TemplateAction.cs
- DynamicMethod.cs
- HTTPNotFoundHandler.cs
- StopRoutingHandler.cs