xsoheilalizadeh / xResult

It represents APIs that help to write functional codes in c#!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xResult (Prototype) 🚦

What is xResult?

It represents APIs that help to write functional codes in c#!

using static xResult.Result;

public class User
{
    private User(string userName)
    {
        UserName = userName;
    }

    public string UserName { get; }

    public static Result<User> New(string userName)
    {
        if (string.IsNullOrEmpty(userName))
        {
            return Fail("The UserName is required!");
        }
        return Ok(new User(userName));
    }
}

About

It represents APIs that help to write functional codes in c#!


Languages

Language:C# 100.0%