Skip to content

A library for expanding the already large number of tools to make our even easier.

License

Notifications You must be signed in to change notification settings

DenevCloud/DenevCloud.Extensions

Repository files navigation

DenevCloud.Extensions

A set of extensions for .NET Core

Usage for DenevCloud.Extensions.Types

using DenevCloud.Extensions.Types;

namespace DenevCloud;

public static class Program
{
    public static async Task Main(string[] args)
    {
        var x = 60;

        var _result = GetResult(x);

        if (_result)
        {
            Console.WriteLine($"The value is: {_result.Unwrap()}");
        }
        else
        {
            Console.WriteLine("There is no value.");
        }

        if(_result == Option.Some)
        {
            Console.WriteLine($"The value is: {await _result.UnwrapAsync(true)}");
        }
        else
        {
            Console.WriteLine("There is no value.");
        }
        
    }

    public static OptionResult<int> GetResult(int x)
    {
        if (x < 50)
        {
            return new Some<int>(x);
        }
        else
        {
            return new None<int>();
        }
    }
}

About

A library for expanding the already large number of tools to make our even easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages