Export (0) Print
Expand All

DbSet.Add Method

Entity Framework 5.0

Adds the given entity to the context the Added state. When the changes are being saved, the entities in the Added states are inserted into the database. After the changes are saved, the object state changes to Unchanged.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

Public Function Add ( _
	entity As Object _
) As Object
Dim instance As DbSet 
Dim entity As Object 
Dim returnValue As Object 

returnValue = instance.Add(entity)


Type: System.Object

The entity to add.

Return Value

Type: System.Object
The entity.

Entities that are already in the context in some other state will have their state set to Added. Add is a no-op if the entity is already in the context in the Added state.

© 2014 Microsoft