Saturday, August 31, 2013

Pass type as string variable

I was thinking something like



public class ValueProcessor : IValueProcessor
{
public ClusterResource ClusterResource(string data)
{
//return something here
}
///////////////////.................

and





public interface IValueProcessor
{
string ClusterResource(string data);
///////////////.....
}

And



private readonly IValueProcessor _valueProcessor;
public SwitchDemo(IValueProcessor valueProcessor)
{
_valueProcessor = valueProcessor;
}



again this is untested

No comments:

Post a Comment