This might be lame, but here:
public interface Interface<T>
{
T Value { get; }
}
public class InterfaceProxy<T> : Interface<T>
{
public T Value { get; set; }
}
public class ImplementedInterface: InterfaceProxy<Double> {}
Now I want to create an instance of the ImplementedInterface
and initialize its members.
Can this be done like this (using an object initializer) or can this only be achieved by using a constructor with Double
argument?
var x = new ImplementedInterface { 30.0 };
Can be done by:
var x = new ImplementedInteface { Value = 30.0 };