public void DeleteTrainingGoal(TrainingGoal goal)
 {
     using (var conn = CreateConnection())
         using (var tran = conn.BeginTransaction())
         {
             try
             {
                 conn.Execute("UPDATE TrainingGoal SET Deleted=@Deleted WHERE Id=@Id", new { goal.Id, Deleted = DateTimeOffset.Now }, tran);
                 tran.Commit();
             }
             catch
             {
                 tran.Rollback();
                 throw;
             }
         }
 }
 public void ActivateTrainingGoal(TrainingGoal goal)
 {
     using (var conn = CreateConnection())
         using (var tran = conn.BeginTransaction())
         {
             try
             {
                 conn.Execute("UPDATE TrainingGoal SET Active=0 WHERE UserId=@UserId", new { goal.UserId }, tran);
                 conn.Execute("UPDATE TrainingGoal SET Active=1 WHERE Id=@Id", new { goal.Id }, tran);
                 tran.Commit();
             }
             catch
             {
                 tran.Rollback();
                 throw;
             }
         }
 }