I have an abstract object Arg is there any chance to use it like this:
Arg<string> Title = "Big Title";
Console.WriteLine(Title);
Output should be: "Big Title"
Can i use implicit operator ?
Base Class is :
public abstract class Arg<T>
where T: class,new()
{
public object Value { get; set; }
public Arg()
{
Value = new T();
}
public static implicit operator T(T t)
{
return t or Value ;
}
public override string ToString()
{
return Value.ToString();
}
}
Any ideas are welcome. Thanks in advance
object
and notT
?