I am working on a trading API (activex from interactive brokers)which has a method called:
void reqMktDataEx(int tickerId, IContract contract, string general
One more way is to have extension method:
public static class BooleanExtensions { public static int ToInt(this bool value) { return value ? 1 : 0; } }
then it can be used:
bool result = false; result.ToInt();