forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjectDeletedException.cs
39 lines (30 loc) · 1.01 KB
/
ObjectDeletedException.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
32
33
34
35
36
37
38
39
using System;
using System.Runtime.Serialization;
namespace NHibernate
{
/// <summary>
/// Thrown when the user tries to pass a deleted object to the <c>ISession</c>.
/// </summary>
[Serializable]
public class ObjectDeletedException : HibernateException
{
private object identifier;
public ObjectDeletedException(string message, object identifier) : base(message)
{
this.identifier = identifier;
}
public object Identifier
{
get { return identifier; }
}
public override string Message
{
get { return base.Message + ": " + identifier; }
}
public ObjectDeletedException(string message, Exception root) : this(message, root.Message) {}
public ObjectDeletedException(string message) : this(message, message) {}
public ObjectDeletedException(Exception root) : this(root.Message, root.Message) {}
public ObjectDeletedException() : this(string.Empty, string.Empty) {}
protected ObjectDeletedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}