title: How to call a method implicitly after every method call?
body: <p>Sorry for the terrific Title for the post. I am bit curious to know if below problem does have any solutions or not. The situation is I have a function called <code>SaveSecurity();</code> which I need to call after every function. Like below:</p>
  
  <pre><code>public void AddUser(string ID, string Name, string Password)
  {
      ///some codes
      SaveSecurity();
  }
  public void DeleteUser(User ObjUser)
  {
      ///some codes
      SaveSecurity();
  }
  public void AddPermission(string ID, string Name, AccessType Access)
  {
      ///some codes
      SaveSecurity();
  }
  public void DeletePermission(Permission ObjPermission)
  {
      ///some codes
      SaveSecurity();
  }
  public void AddRole(string ID, string Name)
  {
      Roles.AddRole(ID, Name);
      SaveSecurity();
  }
  public void SaveSecurity()
  {
      ///Saves the data
  }
  </code></pre>
  
  <p>And many more. So now if we look there is a similarity to all the function is that at last it calls for the <code>SaveSecurity()</code> after the end of the function. My question is: </p>
  
  <blockquote>
    <p>Is there a way to call this function after every function with out writing the same line again and again?</p>
  </blockquote>
  
  <p>My Class Diagram looks like this </p>
  
  <p><a href="https://i.stack.imgur.com/ib3c0.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ib3c0.jpg" alt="enter image description here"></a></p>