Skip to content

Commit 7dc47e0

Browse files
fredericDelaportehazzik
authored andcommitted
NH-4052 - Adding missing serializable implementation (#1456)
- NH-4052 (#663) has introduced a new exception class but has forgotten to provide its serializable implementation.
1 parent 15c95da commit 7dc47e0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/NHibernate/SchemaValidationException.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Collections.Generic;
22
using System.Collections.ObjectModel;
3+
using System.Runtime.Serialization;
4+
using System.Security;
35

46
namespace NHibernate
57
{
@@ -11,5 +13,18 @@ public SchemaValidationException(string msg, IList<string> validationErrors) : b
1113
{
1214
ValidationErrors = new ReadOnlyCollection<string>(validationErrors);
1315
}
16+
17+
protected SchemaValidationException(SerializationInfo info, StreamingContext context) : base(info, context)
18+
{
19+
ValidationErrors =
20+
(ReadOnlyCollection<string>) info.GetValue("ValidationErrors", typeof(ReadOnlyCollection<string>));
21+
}
22+
23+
[SecurityCritical]
24+
public override void GetObjectData(SerializationInfo info, StreamingContext context)
25+
{
26+
base.GetObjectData(info, context);
27+
info.AddValue("ValidationErrors", ValidationErrors);
28+
}
1429
}
1530
}

0 commit comments

Comments
 (0)