-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
DelegateResult.cs
39 lines (34 loc) · 991 Bytes
/
DelegateResult.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
using System;
namespace Polly
{
/// <summary>
/// The captured outcome of executing an individual Func<TResult>
/// </summary>
public class DelegateResult<TResult>
{
private readonly TResult _result;
private readonly Exception _exception;
internal DelegateResult(TResult result)
{
_result = result;
}
internal DelegateResult(Exception exception)
{
_exception = exception;
}
/// <summary>
/// The result of executing the delegate. Will be default(TResult) if an exception was thrown.
/// </summary>
public TResult Result
{
get { return _result; }
}
/// <summary>
/// Any exception thrown while executing the delegate. Will be null if policy executed without exception.
/// </summary>
public Exception Exception
{
get { return _exception; }
}
}
}