Iff operator in C#

image_pdfimage_print
   
 

//Octavalent Extension Methods
//http://sdfasdf.codeplex.com/
//Library of extension methods for .Net create by Octavalent (www.octavalent.nl)


namespace System.OctavalentExtensions
{
    public static class BooleanExtensions
    {
        public static object Iff(this bool value, object valueIfTrue, object valueIfFalse)
        {
            if (value)
                return valueIfTrue;

            return valueIfFalse;
        }
    }
}