Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 601 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 601 Bytes

OutWarden

OutWarden

Simple and straightforward Result type that protects you, among other things, to use the out parameters.

//Here's what classic "tryget" code looks like
public bool TryGetJeans(Pants value, out Jeans jeans)
{
    ...
}

//We've all done that (not really) but let's look at a cleaner alternative...
public Result<Jeans> TryGetJeans(Pants value)
{
    ...
}

Getting started

return Result<T>.Success(value);

return Result<T>.Failure();

return Result<T>.Failure("Something went wrong");