-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathObjectNotFoundException.cs
44 lines (35 loc) · 1.2 KB
/
ObjectNotFoundException.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
40
41
42
43
44
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 ObjectNotFoundException : HibernateException
{
private object identifier;
private System.Type type;
public ObjectNotFoundException(string message, object identifier, System.Type type) : base(message)
{
this.identifier = identifier;
this.type = type;
}
public object Identifier
{
get { return identifier; }
}
public override string Message
{
get { return base.Message + ": " + identifier + ", of class: " + type.FullName; }
}
public System.Type Type
{
get { return type; }
}
public ObjectNotFoundException(string message, Exception root) : this(message, root.Message, typeof(ObjectNotFoundException)) {}
public ObjectNotFoundException(string message) : this(message, message, typeof(ObjectNotFoundException)) {}
public ObjectNotFoundException(Exception root) : this(root.Message, root.Message, typeof(ObjectNotFoundException)) {}
protected ObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}