The entire object graph will be saved to the database in an implicit transaction.
If there is a problem saving any object, the implicit transation will be automatically rolled back.
To save child or parents seperately, define relationships as atributes.
The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown.
Example primary keys: Id or CustomerId
If the primary is zero, the object will be inserted and set when it is saved.
If the primary key is greater than zero the object will be updated.
CreateDate, if defined will be filled in with the DateTime.Now during an insert
UpdateDate, if defined will be filled in with the DateTime.Now during an update.
Overload List
Overload | Description |
Save<T>(T) | The entire object graph will be saved to the database in an implicit transaction.
If there is a problem saving any object, the implicit transation will be automatically rolled back.
To save child or parents seperately, define relationships as atributes.
The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown.
Example primary keys: Id or CustomerId
If the primary is zero, the object will be inserted and set when it is saved.
If the primary key is greater than zero the object will be updated.
CreateDate, if defined will be filled in with the DateTime.Now during an insert
UpdateDate, if defined will be filled in with the DateTime.Now during an update. |
Save<T>(List<T>) | Save an object list to the database in an implicit transaction.
If there is a problem saving any object, the implicit transation will be automatically rolled back.
To save child or parents seperately, define relationships as atributes.
The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown.
Example primary keys: Id or CustomerId
If IsDeleted is defined, the object will be deleted from the datbase.
If the primary is zero, the object will be inserted.
If the primary key is greater than zero the object will be updated.
If IsDeleted is defined and it is true, the item will be deleted.
If IsDirty is defined and it is true, the item will be saved. IsDirty will be set to false after the save.
If IsDirty is not defined, the item will be saved. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also