Skip to content

Commit 47b6642

Browse files
Merge pull request #6 from DixonDs/fix-method-invocation-result
Fixed MethodInvocationResult.Successful property
2 parents db07d3a + e2b58cf commit 47b6642

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/StructureMap.DynamicInterception/MethodInvocationResult.cs

+4-16
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,15 @@ public MethodInvocationResult(Exception exception)
1717
_exceptionDispatchInfo = ExceptionDispatchInfo.Capture(exception);
1818
}
1919

20-
public bool Successful
21-
{
22-
get { return _exceptionDispatchInfo != null; }
23-
}
20+
public bool Successful => _exceptionDispatchInfo == null;
2421

25-
public object ReturnValue { get; private set; }
22+
public object ReturnValue { get; }
2623

27-
public Exception Exception
28-
{
29-
get
30-
{
31-
return _exceptionDispatchInfo != null ? _exceptionDispatchInfo.SourceException : null;
32-
}
33-
}
24+
public Exception Exception => _exceptionDispatchInfo?.SourceException;
3425

3526
public object GetReturnValueOrThrow()
3627
{
37-
if (_exceptionDispatchInfo != null)
38-
{
39-
_exceptionDispatchInfo.Throw();
40-
}
28+
_exceptionDispatchInfo?.Throw();
4129

4230
return ReturnValue;
4331
}

0 commit comments

Comments
 (0)