Skip to content

Protects your code from pesky 'out' keywords by providing a TryGetResult type

License

Notifications You must be signed in to change notification settings

Moreault/OutWarden

Repository files navigation

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");

About

Protects your code from pesky 'out' keywords by providing a TryGetResult type

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages