ObjectStateManager.TryGetRelationshipManager(Object, RelationshipManager) Metodo

Definizione

Restituisce l'oggetto RelationshipManager utilizzato dall'oggetto specificato.Returns the RelationshipManager that is used by the specified object.

public:
 bool TryGetRelationshipManager(System::Object ^ entity, [Runtime::InteropServices::Out] System::Data::Objects::DataClasses::RelationshipManager ^ % relationshipManager);
public bool TryGetRelationshipManager (object entity, out System.Data.Objects.DataClasses.RelationshipManager relationshipManager);
member this.TryGetRelationshipManager : obj * RelationshipManager -> bool
Public Function TryGetRelationshipManager (entity As Object, ByRef relationshipManager As RelationshipManager) As Boolean

Parametri

entity
Object

Oggetto per il quale restituire l'oggetto RelationshipManager.The object for which to return the RelationshipManager.

relationshipManager
RelationshipManager

Quando termina, questo metodo contiene l'oggetto RelationshipManager dell'oggetto entity.When this method returns, contains the RelationshipManager for the entity.

Restituisce

true se un'istanza di RelationshipManager è stata restituita per l'oggetto entity fornito. In caso contrario, false.true if a RelationshipManager instance was returned for the supplied entity; otherwise false.

Commenti

Il GetRelationshipManager metodo viene usato per ottenere per RelationshipManager gli oggetti che sono ignoranti per la persistenza.The GetRelationshipManager method is used to obtain the RelationshipManager for objects that are persistence ignorant. Quando gli oggetti IEntityWithRelationships implementano o EntityObjectereditano RelationshipManager da, RelationshipManager l'oggetto è accessibile dalla proprietà.When objects implement IEntityWithRelationships or inherit from EntityObject, the RelationshipManager is accessed from the RelationshipManager property.

Non può essere restituito quando l'oggetto si trova in Detached uno stato. RelationshipManagerThe RelationshipManager cannot be returned when the object is in a Detached state.

La chiamata al GetRelationshipManager false metodo equivale alla chiamata al metodo, con la differenza che questo metodo restituisce anziché generare un'eccezione. TryGetRelationshipManagerCalling the TryGetRelationshipManager method is the same as calling the GetRelationshipManager method, except that this method returns false instead of raising an exception.

Si applica a