Skip to content

VicenzoMartinelli/LazyConditions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LazyConditions

Example

using LazyConditions;
using System.Threading.Tasks;

namespace Samples
{
    public class Sample
    {
        public async Task<bool> Validate()
        {
            return await Conditions.AllFalseAsync(
                LazyTask<bool>.Create(() => Task.FromResult(false)).Get(),
                LazyTask<bool>.Create(async () => await ValidateSomenthing()).Get(),
                LazyTask<bool>.Create(async () => await ValidateAnoterThing()).Get()
            );
        }

        private async Task<bool> ValidateSomenthing()
        {
            return true;
        }

        private async Task<bool> ValidateAnoterThing()
        {
            return false;
        }
    }
}

About

Small library to check list of conditions in a performatic way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages