Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedayismyenemy/simpleoutcome
https://github.com/thedayismyenemy/simpleoutcome
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thedayismyenemy/simpleoutcome
- Owner: TheDayIsMyEnemy
- Created: 2023-12-06T11:30:17.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-06T13:19:24.000Z (12 months ago)
- Last Synced: 2024-11-05T22:12:39.635Z (10 days ago)
- Language: C#
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Simple Operation Result
## Example
```csharp
// Create a new successful Result with an optional message
var operationOne = Result.Success().WithMessage("Operation successfully completed.");// Create a new failure Result, provide custom data, and chain multiple messages
var operationTwo = Result
.Failure(new ImaginaryTaskObject())
.WithMessage("{0} operation failed", nameof(ImaginaryTaskObject))
.WithMessage("Previous operation status: {0}", operationOne.ToString());// Retrieve the instance of ImaginaryTaskObject from the result
var data = operationTwo.Data;// Create a new successful Result and add a list of informative messages
Result
.Success()
.WithListOf($"{nameof(operationOne)} Status: {operationOne.IsSuccess}",
$"{nameof(operationTwo)} Data: {data.ToString()}");```