Thanks to visit codestin.com
Credit goes to github.com

Skip to content

taifatang/OkBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OkBundle

A simple condition block alternative, with fluent API for .NET

  • Ideas by ZhongMingChen
  • Implemented by TaiFaTang

###If If and ElseIf both takes a predicate e.g. 1+1, true || true

The follow command are available If, Do, ElseIf, Else

Ok
	.If().Do(() => {} )
	.ElseIf().Do(() => {})
	.Else( () => {})

Example:

Ok
  .If(1 == 2).Do( () => { Console.WriteLine("HelloWorld!") } )
  .ElseIf(3 == 3).Do( () => { Console.WriteLine("FooBar!") } )
  .Else( () => { Console.WriteLine("I am not called :[ ") } )

###Switch Switch() will take any object. Case() can be same or any other type

The follow command are available Switch, Case, Do

Ok
  .Switch()
  .Case().Do( () => {})
  .Case().Do( () => {})

Example:

Ok
  .Switch(RandomEnum.Food)
  .Case(RandomEnum.Drink).Do( () => { Console.WriteLine("I am no executed :[ ") } )
  .Case(RandomEnum.Food).Do( () => { Console.WriteLine("I am executed!") } )

###While In Progress ETA - End of Jan ###Foreach Up Next ETA - Begining of Feb ###For Up Next ETA - Mid of Feb ###More & Improvment Up Next

About

A simple fluent condition block alternative

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages