Skip to content

OnionFunc is a super simple .NET helper library for building pipelines with middleware patterns.

License

Notifications You must be signed in to change notification settings

in-async/OnionFunc

Repository files navigation

OnionFunc

Build status NuGet

OnionFunc は middleware pattern によってパイプラインを構築する為の、非常にシンプルな .NET ヘルパーライブラリです。

Target Frameworks

  • .NET Standard 2.0+
  • .NET Standard 1.0+
  • .NET Framework 4.5+

Usage

Func<int, bool> handler = num => true;
Assert.AreEqual(true, handler(24));

Func<int, bool> onionFunc = handler
    .Layer(next => num => (num % 3 == 0) && next(num))
    .Layer(next => num => (num % 4 == 0) && next(num))
    ;
Assert.AreEqual(true, onionFunc(24));
Assert.AreEqual(false, onionFunc(30));

Licence

This project is licensed under the MIT License - see the LICENSE file for details

About

OnionFunc is a super simple .NET helper library for building pipelines with middleware patterns.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages