title: Simple Injector Transaction Handling
body: <p>I am migrating my project from Spring.Net to Simple Injector. In Spring.Net, there is a concept of having several functions nested under a single transaction using transaction decorator. The functionality of the Transaction decorator was to Rollback the transactions (including the DB inserts/updated) on Error across nested functions / service functions which would have a DB call individually.</p>
  
  <p>Is there any equivalent in Simple Injector?</p>
  
  <h2>Sample Code of Spring.NET below</h2>
  
  <p>User Service</p>
  
  <pre><code>  [Transaction(TransactionPropagation.Required)]
      public bool RegisterUser(UserModel)
      {
      //Insert User DB Call
      int result = _Userrepository.UserInsert(UserModel);
      _subscriberservice.InsertSubscriber(UserModel);
  
  }
  </code></pre>
  
  <p>Subscriber Service</p>
  
  <pre><code>    public bool InsertSubscriber(UserModel);
      {
      //Insert Subscriber DB Call
      int result = _subscriberrepository.SubscriberInsert(UserModel);
  
  }
  </code></pre>
  
  <p>If the Insert Subscriber Service Insert fails, the User Insert also has to Roll back</p>