public async Task<DbStatus> Delete(Doctor doctor)
        {
            List<string> commandsToExecute = new List<string>();
            IConnector connector = ConnectorFactory.CreateConnector();
            MySqlConnection connection = connector.CreateConnection();
            await connector.OpenConnection(connection);
            foreach (var clinic in doctor.GetClinics())
            {

                commandsToExecute.Add(new DeleteCommand<DoctorClinic>().GetCommand(connection, clinic.GetAssociatedDbTableName(), clinic).CommandText);
            }
            foreach (var title in doctor.GetMedicalTitles())
            {
                commandsToExecute.Add(new DeleteCommand<DoctorMedicalTitle>().GetCommand(connection, title.GetAssociatedDbTableName(), title).CommandText);
            }
            commandsToExecute.Add(new DeleteCommand<Doctor>().GetCommand(connection, doctor.GetAssociatedDbTableName(), doctor).CommandText);
            DbTransactionProcedure transactionProcedure = new DeleteDbTransactionProcedure(commandsToExecute.ToArray());
            DbStatus status = await transactionProcedure.Execute();
            return status;
        }
        public async Task <DbStatus> Delete(LocalAccount localAccount)
        {
            List <string>   commandsToExecute = new List <string>();
            IConnector      connector         = ConnectorFactory.CreateConnector();
            MySqlConnection connection        = connector.CreateConnection();
            await connector.OpenConnection(connection);

            foreach (var role in localAccount.GetRoles())
            {
                LocalAccountRole lr = new LocalAccountRole()
                {
                    IdLocalAccount = localAccount.IdLocalAccount,
                    IdRole         = role.IdRole
                };
                commandsToExecute.Add(new DeleteCommand <LocalAccountRole>().GetCommand(connection, lr.GetAssociatedDbTableName(), lr).CommandText);
            }
            commandsToExecute.Add(new DeleteCommand <LocalAccount>().GetCommand(connection, localAccount.GetAssociatedDbTableName(), localAccount).CommandText);
            DbTransactionProcedure transactionProcedure = new DeleteDbTransactionProcedure(commandsToExecute.ToArray());
            DbStatus status = await transactionProcedure.Execute();

            return(status);
        }