Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 513 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 513 Bytes

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