EntityReference<TEntity>.Attach Method (TEntity)
Creates a many-to-one or one-to-one relationship between two objects in the object context.
Assembly: EntityFramework (in EntityFramework.dll)
Exception | Condition |
---|---|
ArgumentNullException | When the entity is null. |
InvalidOperationException | When the entity cannot be related to the current related end. This can occur when the association in the conceptual schema does not support a relationship between the two types. |