May 1.0.0

General Information

This is a result pattern implementation. While this is nothing new, as I started to this project, there were a lot of variants. I've combined existing libraries and added some use case specific changes to them for my taste.

Getting Started

  1. I want it to be assignable from any object

    For example:

    TestClass test = new TestClass();
    Maybe<TestClass> maybe = test;
    TestClass fromMaybe = maybe.Value; 
    
  2. I want it to be assignable from error

    var error = Error.Invalid();
    Maybe<TestClass> maybe = error;
    var isError = maybe.IsError; // true
    var error = maybe.Error; // Error.Invalid();
    
  3. I want validation errors to be seperated from regular errors. Validation errors are the ones that should cause immediate failure before business logic executes. While normal validation error can happen on business logic as well, but generally it creates different error messages to the client

    var errors = [ValidationError.From("...","..."), ValidationError.From("...","...")];
    Maybe<TestClass> maybe = errors;
    var isError = maybe.IsInvalid; // true;
    var validationErrors = maybe.ValidationErrors; // Error.Invalid();
    

Getting Started

TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:

  1. Installation process
  2. Software dependencies
  3. Latest releases
  4. API references

Build and Test

TODO: Describe and show how to build your code and run the tests.

Contribute

TODO: Explain how other users and developers can contribute to make your code better.

If you want to learn more about creating good readme files then refer the following guidelines. You can also seek inspiration from the below readme files:

No packages depend on May.

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET 10.0

  • No dependencies.

Version Downloads Last updated
1.0.0 2 02/14/2026