-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from NerosoftDev/develop
Develop
- Loading branch information
Showing
36 changed files
with
787 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
namespace Nerosoft.Euonia.Bus.RabbitMq; | ||
|
||
internal class RabbitMqReply<TResult> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the result. | ||
/// </summary> | ||
public TResult Result { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the error. | ||
/// </summary> | ||
public Exception Error { get; set; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether this message handing is success. | ||
/// </summary> | ||
public bool IsSuccess => Error == null; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="result"></param> | ||
/// <returns></returns> | ||
public static RabbitMqReply<TResult> Success(TResult result) | ||
{ | ||
return new RabbitMqReply<TResult> | ||
{ | ||
Result = result | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="error"></param> | ||
/// <returns></returns> | ||
public static RabbitMqReply<TResult> Failure(Exception error) | ||
{ | ||
return new RabbitMqReply<TResult> | ||
{ | ||
Error = error | ||
}; | ||
} | ||
} |
Oops, something went wrong.