Operations with Booleans

Tango.CommonOperations.BoolOperations

This static class contains methods and properties to expose common operations to work with bool types.

All members bellow returns the corresponding functions as delegates.

Properties

Name

Type

Description

Not

Func<bool, bool>

Function to represents the operator !.

And

Func<bool, bool, bool>

Function to represents the and (&&) operation between two booleans.

Or

Func<bool, bool, bool>

Function to represents the or (||) operation between two booleans..

Methods

Name

Parameters

Returns

Description

AndWith

bool value

Func<bool, bool>

Function to represents the and (&&) operation between two booleans. Applying the first boolean with Partial Application.

OrWith

bool value

Func<bool, bool>

Function to represents the or (||) operation between two booleans. Applying the first boolean with Partial Application.

Usage

The properties returns a delegate, so, it's possible to use it as a method.

Not

Or

And

For methods you can use a little different sintax. It's necessary because these methods uses the property methods combined with Partial Application.

Because of that, you need to execute the method with the first parameter to creates a new single parameter function that perform the operation.

OrWith

You can also use it as a chainable operation:

AndWith

You can also use it as a chainable operation:

Last updated

Was this helpful?