Table<TEntity>.GetOriginalEntityState(TEntity) 方法
定义
返回包含实体原始状态的 Table<TEntity> 实例。Returns a Table<TEntity> instance that contains the original state of the entity.
public:
TEntity GetOriginalEntityState(TEntity entity);
public TEntity GetOriginalEntityState (TEntity entity);
member this.GetOriginalEntityState : 'Entity -> 'Entity
Public Function GetOriginalEntityState (entity As TEntity) As TEntity
参数
- entity
- TEntity
要返回其原始状态的实体。The entity whose original state is to be returned.
返回
- TEntity
一个 Table<TEntity> 实例,其中包含实体的原始状态。A Table<TEntity> instance that contains the original state of the entity.
注解
此方法将返回实体的原始状态,因为它是创建的或附加到当前的 DataContext 。This method returns the original state of an entity since it was either created or attached to the current DataContext. 已序列化和反序列化的实体的原始状态必须由独立的跟踪机制提供,并在将实体附加到新的时提供 DataContext 。The original state of an entity that has been serialized and deserialized must be provided by an independent tracking mechanism and supplied when the entity is attached to a new DataContext. 有关详细信息,请参阅 N 层应用程序中的数据检索和 CUD 操作 (LINQ to SQL) 。For more information, see Data Retrieval and CUD Operations in N-Tier Applications (LINQ to SQL).