C# Wrapping a primitive
<p>I known that deriving a class from a primitive is not possible, however, I would like my class to 'seem' like it's a primitive without casting. In this case, my class would operate much like a Decimal:</p>

<pre><code>    public interface IFoo
    {
        static explicit operator Decimal(IFoo tFoo);
    }

    public class Foo: IFoo
    {
        private Decimal m_iFooVal;

        public Decimal Value
        {
            get { return m_iFooVal; }
            set { m_iFooVal= value; }
        }

        static explicit operator Decimal(IFoo tFoo)
        {
            return (tFoo as Foo).Value;
        }

    }
</code></pre>

<p>The above code doesn't work because the explicit operator cannot be defined in an interface. My code deals with interfaces and I would like to keep it like that. Is it possible to convert IFoo to a Decimal? Any alternatives are welcome. Example:</p>

<pre><code>IFoo tMyFooInterfaceReference = GetFooSomehow();    
Decimal iVal = tMyFooInterfaceReference;
</code></pre>
