Share via


ObjectContext.AddObject(String, Object) Method

Definition

Adds an object to the object context.

public virtual void AddObject (string entitySetName, object entity);
abstract member AddObject : string * obj -> unit
override this.AddObject : string * obj -> unit
Public Overridable Sub AddObject (entitySetName As String, entity As Object)

Parameters

entitySetName
String

Represents the entity set name, which may optionally be qualified by the entity container name.

entity
Object

The Object to add.

Exceptions

The entity parameter is null or the entitySetName does not qualify.

Applies to