forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreDeleteEvent.cs
31 lines (29 loc) · 1.12 KB
/
PreDeleteEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using NHibernate.Persister.Entity;
namespace NHibernate.Event
{
/// <summary>
/// Represents a <tt>pre-delete</tt> event, which occurs just prior to
/// performing the deletion of an entity from the database.
/// </summary>
public class PreDeleteEvent : AbstractPreDatabaseOperationEvent
{
/// <summary>
/// Constructs an event containing the pertinent information.
/// </summary>
/// <param name="entity">The entity to be deleted. </param>
/// <param name="id">The id to use in the deletion. </param>
/// <param name="deletedState">The entity's state at deletion time. </param>
/// <param name="persister">The entity's persister. </param>
/// <param name="source">The session from which the event originated. </param>
public PreDeleteEvent(object entity, object id, object[] deletedState, IEntityPersister persister, IEventSource source)
: base(source, entity, id, persister)
{
DeletedState = deletedState;
}
/// <summary>
/// This is the entity state at the
/// time of deletion (useful for optimistic locking and such).
/// </summary>
public object[] DeletedState { get; private set; }
}
}