Skip to content

Commit 7697cd5

Browse files
committed
Serializable
1 parent 86c61d1 commit 7697cd5

File tree

10 files changed

+0
-167
lines changed

10 files changed

+0
-167
lines changed

src/CommandQuery.Client/CommandQueryException.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
using System;
2-
using System.Runtime.Serialization;
3-
using System.Security.Permissions;
42

53
namespace CommandQuery.Client
64
{
75
/// <summary>
86
/// Represents errors that occur when receiving HTTP responses in the <see cref="CommandClient"/> and <see cref="QueryClient"/>.
97
/// </summary>
10-
[Serializable]
118
public class CommandQueryException : Exception
129
{
1310
/// <summary>
@@ -47,34 +44,9 @@ public CommandQueryException(string message, IError? error)
4744
Error = error;
4845
}
4946

50-
/// <summary>
51-
/// Initializes a new instance of the <see cref="CommandQueryException"/> class.
52-
/// </summary>
53-
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
54-
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
55-
protected CommandQueryException(SerializationInfo info, StreamingContext context)
56-
: base(info, context)
57-
{
58-
Error = info.GetValue("Error", typeof(Error)) as Error;
59-
}
60-
6147
/// <summary>
6248
/// Represents an error that occurred during the processing of a command or query.
6349
/// </summary>
6450
public IError? Error { get; set; }
65-
66-
/// <inheritdoc />
67-
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
68-
public override void GetObjectData(SerializationInfo info, StreamingContext context)
69-
{
70-
if (info is null)
71-
{
72-
throw new ArgumentNullException(nameof(info));
73-
}
74-
75-
info.AddValue("Error", Error, typeof(Error));
76-
77-
base.GetObjectData(info, context);
78-
}
7951
}
8052
}

src/CommandQuery.Client/Internal/Error.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
using System;
21
using System.Collections.Generic;
32

43
namespace CommandQuery.Client
54
{
6-
[Serializable]
75
internal class Error : IError
86
{
9-
public Error()
10-
{
11-
}
12-
137
public string? Message { get; set; }
148

159
public Dictionary<string, object>? Details { get; set; }

src/CommandQuery/Exceptions/CommandException.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during command processing in a command handler.
87
/// Derive custom command exceptions from this class and add public properties to expose more error details.
98
/// </summary>
10-
[Serializable]
119
public class CommandException : Exception
1210
{
1311
/// <summary>
@@ -33,13 +31,5 @@ public CommandException(string message, Exception innerException)
3331
: base(message, innerException)
3432
{
3533
}
36-
37-
/// <summary>Initializes a new instance of the <see cref="CommandException"/> class with serialized data.</summary>
38-
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
39-
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
40-
protected CommandException(SerializationInfo info, StreamingContext context)
41-
: base(info, context)
42-
{
43-
}
4434
}
4535
}

src/CommandQuery/Exceptions/CommandProcessorException.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during command processing in the <see cref="CommandProcessor"/>.
87
/// </summary>
9-
[Serializable]
108
public sealed class CommandProcessorException : Exception
119
{
1210
/// <summary>
@@ -32,10 +30,5 @@ public CommandProcessorException(string message, Exception innerException)
3230
: base(message, innerException)
3331
{
3432
}
35-
36-
private CommandProcessorException(SerializationInfo info, StreamingContext context)
37-
: base(info, context)
38-
{
39-
}
4033
}
4134
}

src/CommandQuery/Exceptions/CommandTypeException.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during initialization of a <see cref="CommandTypeProvider"/>.
87
/// </summary>
9-
[Serializable]
108
public sealed class CommandTypeException : Exception
119
{
1210
/// <summary>
@@ -32,10 +30,5 @@ public CommandTypeException(string message, Exception innerException)
3230
: base(message, innerException)
3331
{
3432
}
35-
36-
private CommandTypeException(SerializationInfo info, StreamingContext context)
37-
: base(info, context)
38-
{
39-
}
4033
}
4134
}

src/CommandQuery/Exceptions/QueryException.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during query processing in a query handler.
87
/// Derive custom query exceptions from this class and add public properties to expose more error details.
98
/// </summary>
10-
[Serializable]
119
public class QueryException : Exception
1210
{
1311
/// <summary>
@@ -33,13 +31,5 @@ public QueryException(string message, Exception innerException)
3331
: base(message, innerException)
3432
{
3533
}
36-
37-
/// <summary>Initializes a new instance of the <see cref="QueryException"/> class with serialized data.</summary>
38-
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
39-
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
40-
protected QueryException(SerializationInfo info, StreamingContext context)
41-
: base(info, context)
42-
{
43-
}
4434
}
4535
}

src/CommandQuery/Exceptions/QueryProcessorException.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during query processing in the <see cref="QueryProcessor"/>.
87
/// </summary>
9-
[Serializable]
108
public sealed class QueryProcessorException : Exception
119
{
1210
/// <summary>
@@ -32,10 +30,5 @@ public QueryProcessorException(string message, Exception innerException)
3230
: base(message, innerException)
3331
{
3432
}
35-
36-
private QueryProcessorException(SerializationInfo info, StreamingContext context)
37-
: base(info, context)
38-
{
39-
}
4033
}
4134
}

src/CommandQuery/Exceptions/QueryTypeException.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using System;
2-
using System.Runtime.Serialization;
32

43
namespace CommandQuery.Exceptions
54
{
65
/// <summary>
76
/// Represents errors that occur during initialization of a <see cref="QueryTypeProvider"/>.
87
/// </summary>
9-
[Serializable]
108
public sealed class QueryTypeException : Exception
119
{
1210
/// <summary>
@@ -32,10 +30,5 @@ public QueryTypeException(string message, Exception innerException)
3230
: base(message, innerException)
3331
{
3432
}
35-
36-
private QueryTypeException(SerializationInfo info, StreamingContext context)
37-
: base(info, context)
38-
{
39-
}
4033
}
4134
}

tests/CommandQuery.Tests/Client/CommandQueryExceptionTests.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/CommandQuery.Tests/Exceptions/ExceptionTests.cs

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)