I am wondering if there is any language feature/library/tools/techniques I could use to call .NET/C# "functions" in a pipeline in a scripting environment? For example, I have
public interface IFoo
{
...
}
public interface IBar
{
IFoo Load(string fileName);
IFoo Replace(string oldValue, string newValue);
void Save(string fileName);
}
Then wrap them in util.exe with proper Main(). Now I want to use them like piped DOS command:
util.exe -load in.txt | util.exe -replace x y | util.exe -save output.txt
Is it possible? Is there any constraint on IFoo because it can be complex data structure that can't be easily serialized to ASCII string. What's the way to get there?
.. But your example doesn't make sense. How would you call anIBarmethod on anIFoo?