forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDuplicateMappingException.cs
67 lines (61 loc) · 1.92 KB
/
DuplicateMappingException.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Runtime.Serialization;
namespace NHibernate
{
[Serializable]
public class DuplicateMappingException : MappingException
{
private string type;
private string name;
/// <summary>
/// The type of the duplicated object
/// </summary>
public string Type
{
get { return type; }
}
/// <summary>
/// The name of the duplicated object
/// </summary>
public string Name
{
get { return name; }
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingException"/> class.
/// </summary>
/// <param name="customMessage">The message that describes the error. </param>
/// <param name="name">The name of the duplicate object</param>
/// <param name="type">The type of the duplicate object</param>
public DuplicateMappingException(String customMessage, String type, String name)
: base(customMessage)
{
this.type = type;
this.name = name;
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingException"/> class.
/// </summary>
/// <param name="name">The name of the duplicate object</param>
/// <param name="type">The type of the duplicate object</param>
public DuplicateMappingException(String type, String name)
: this(string.Format("Duplicate {0} mapping {1}", type, name), type, name)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="MappingException"/> 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>
public DuplicateMappingException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}