public void Delete(Guid orderId)
 {
     var @event = new OrderDeleted(orderId);
     var eventToPersist = ConvertToPersistentEvent(@event);
     using (var connection = new SqlConnection(SqlConnectionLocator.LocalhostSqlExpress())) {
         connection.Execute(SqlQueries.InsertOrderEventQuery, eventToPersist);
     }
 }
 public void Delete(Guid orderId)
 {
     var @event = new OrderDeleted(orderId);
     var eventToPersist = ConvertToPersistentEvent(@event);
     using (var dataContext = new DataContext()) {
         dataContext.Set<OrderEvent>().Add(eventToPersist);
         dataContext.SaveChanges();
     }
 }
 private void ApplyOrderDeleted(OrderDeleted @event)
 {
     _isDeleted = true;
 }