I have following code. Under order class I am calling DoSomething() explicitly inside ProcessOrder() and SubmitOrder() method.
But I want DoSomething to get called implicitly inside every public method of Order class whenever that method is called by external code. This is applicable to all the methods including the public methods that I will be adding to Order class in future.
public class Order
{
private bool DoSomeThing()
{
// Do something and return result as bool
}
public void ProcessOrder()
{
DoSomeThing();
// Process order logic
}
public void SubmitOrder()
{
DoSomeThing();
// Process order logic
}
}