PutridParrot.Options/Optional.cs
/// <summary>
/// Compare's this optional with the supplied
/// optional value or value argument, if the 
/// argument is not an Optional then it's value
/// os compared, hence you can compare an optional
/// to another optional or a value
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
Compare's this optional with the supplied
optional value or value argument, if the
argument is not an Optional then it's value
os compared, hence you can compare an optional
to another optional or a value
Compare ' s this optional with the supplied optional value or value argument if the argument is not an Optional then it ' s value os compared hence you can compare an optional to another optional or a value
public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
                return true;
            var otherOptional = obj as Optional<T>;
            var otherValue = otherOptional != null ? otherOptional.Value : obj;
            var otherHasValue = otherOptional != null ? otherOptional._hasValue : otherValue != null;
            return Object.Equals(_value, otherValue) && _hasValue == otherHasValue;
        }
public override bool Equals ( object obj ) { if ( ReferenceEquals ( this , obj ) ) return true ; var otherOptional = obj as Optional < T > ; var otherValue = otherOptional != null ? otherOptional . Value : obj ; var otherHasValue = otherOptional != null ? otherOptional . _hasValue : otherValue != null ; return Object . Equals ( _value , otherValue ) && _hasValue == otherHasValue ; }
Compare's this optional with the supplied
optional value or value argument, if the
argument is not an Optional then it's value
os compared, hence you can compare an optional
to another optional or a value
Compare ' s this optional with the supplied optional value or value argument if the argument is not an Optional then it ' s value os compared hence you can compare an optional to another optional or a value
None
obj
object
None