EntityCollection<TEntity>.Clear 方法
定义
从集合中移除所有实体。Removes all entities from the collection.
public:
virtual void Clear();
public void Clear ();
override this.Clear : unit -> unit
Public Sub Clear ()
实现
注解
Clear 执行下列操作:Clear does the following:
从集合中移除所有实体。Removes all entities from the collection.
从 EntityCollection<TEntity> 分离移除的实体和 ObjectStateManager 的所有者之间的关系。Detaches relationships between removed entities and the owner of the EntityCollection<TEntity> from the ObjectStateManager.
从相关实体移除 EntityCollection<TEntity> 的所有者。Removes the owner of the EntityCollection<TEntity> from the related entities.