Called before an object is saved

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
bool OnSave(
	Object entity,
	Object id,
	Object[] state,
	string[] propertyNames,
	IType[] types
)
Visual Basic
Function OnSave ( _
	entity As Object, _
	id As Object, _
	state As Object(), _
	propertyNames As String(), _
	types As IType() _
) As Boolean
Visual C++
bool OnSave(
	Object^ entity, 
	Object^ id, 
	array<Object^>^ state, 
	array<String^>^ propertyNames, 
	array<IType^>^ types
)

Parameters

entity
Type: System..::..Object

[Missing <param name="entity"/> documentation for "M:NHibernate.IInterceptor.OnSave(System.Object,System.Object,System.Object[],System.String[],NHibernate.Type.IType[])"]

id
Type: System..::..Object

[Missing <param name="id"/> documentation for "M:NHibernate.IInterceptor.OnSave(System.Object,System.Object,System.Object[],System.String[],NHibernate.Type.IType[])"]

state
Type: array<System..::..Object>[]()[][]

[Missing <param name="state"/> documentation for "M:NHibernate.IInterceptor.OnSave(System.Object,System.Object,System.Object[],System.String[],NHibernate.Type.IType[])"]

propertyNames
Type: array<System..::..String>[]()[][]

[Missing <param name="propertyNames"/> documentation for "M:NHibernate.IInterceptor.OnSave(System.Object,System.Object,System.Object[],System.String[],NHibernate.Type.IType[])"]

types
Type: array<NHibernate.Type..::..IType>[]()[][]

[Missing <param name="types"/> documentation for "M:NHibernate.IInterceptor.OnSave(System.Object,System.Object,System.Object[],System.String[],NHibernate.Type.IType[])"]

Return Value

trueTruetruetrue (True in Visual Basic) if the user modified the state in any way

Remarks

The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object

See Also