forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjectNotFoundException.cs
47 lines (42 loc) · 1.71 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
45
46
47
using System;
using System.Runtime.Serialization;
namespace NHibernate
{
/// <summary>
/// Thrown when <c>ISession.Load()</c> fails to select a row with
/// the given primary key (identifier value). This exception might not
/// be thrown when <c>Load()</c> is called, even if there was no
/// row on the database, because <c>Load()</c> returns a proxy if
/// possible. Applications should use <c>ISession.Get()</c> to test if
/// a row exists in the database.
/// </summary>
[Serializable]
public class ObjectNotFoundException : UnresolvableObjectException
{
/// <summary>
/// Initializes a new instance of the <see cref="ObjectNotFoundException"/> class.
/// </summary>
/// <param name="identifier">The identifier of the object that was attempting to be loaded.</param>
/// <param name="type">The <see cref="System.Type"/> that NHibernate was trying to find a row for in the database.</param>
public ObjectNotFoundException(object identifier, System.Type type) : base(identifier, type)
{
}
public ObjectNotFoundException(object identifier, string entityName) : base(identifier, entityName) {}
#region ISerializable Members
/// <summary>
/// Initializes a new instance of the <see cref="ObjectNotFoundException"/> class
/// with serialized data.
/// </summary>
/// <param name="info">
/// The <see cref="SerializationInfo"/> that holds the serialized object
/// data about the exception being thrown.
/// </param>
/// <param name="context">
/// The <see cref="StreamingContext"/> that contains contextual information about the source or destination.
/// </param>
protected ObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endregion
}
}