title: Pattern or design for sync database with external provider? (best practice)
body: <p>Your advice is needed! I'm just out for some sort of pseudo-code/idea of what way to go that are robust and reliable. Maybe there exist a usefull pattern for the purpose?</p>
  
  <pre><code>void AddDevice(string itemId);
  </code></pre>
  
  <p>I have a interface with some methods (above is one). In a new class, that implements the interface, there are an external provider involved which need to be informed of updates in the class. </p>
  
  <p>The class itself is get/sets information to a sql server database. Some (not all) of the information must be pushed to the external provider.</p>
  
  <p>This give me two scenarios (which I ask for help)</p>
  
  <ol>
  <li><p>WriteOnlytoDatabase = true / false
  I would like to use same method in both cases, without using a method bool parameter. Is that possible? Could a delegate being used to switch between the difference? Please remember it's a interface here (that GUI talks to).</p></li>
  <li><p>Two transfers, how to track errors
  Because we do two transfers (database, external provider) there can be error that make one or other unavailable. If error on the external provider, I think of some sort of "undone actions queue" to handle..</p></li>
  </ol>
  
  <p>Advices are welcome.. 
  This could be solved on a dousin of ways but there are more or less good designs :)</p>
  
  <blockquote>
    <p>[Reply from Matías below was wroted
    before my edit of question]</p>
  </blockquote>