internal List <Dictionary <EntityField, object> > GetAttributesOfObjects(Entity entity, List <EntityField> fields, object[] values)
        {
            CurrentOperation = DatabaseOperation.SELECT;
            MySqlCommand command = GetMySqlCrudCommand(entity).GetSelectCommand(fields);

            command.Transaction = Transaction;

            for (int i = 0; i < values.Length; i++)
            {
                command.Parameters[i].Value = MySqlTypeConverter.Convert(fields[i], values[i]);
            }

            MySqlDataReader reader = null;

            try
            {
                reader = command.ExecuteReader();
            }
            catch (Exception exc)
            {
                reader.Close();
                Transaction.Rollback();
            }

            List <Dictionary <EntityField, object> > attributesOfObjects = new List <Dictionary <EntityField, object> >();

            while (reader.Read())
            {
                Dictionary <EntityField, object> objectFieldValueList = ReadRow(entity, reader);
                attributesOfObjects.Add(objectFieldValueList);
            }
            reader.Close();

            return(attributesOfObjects);
        }
        internal Dictionary <EntityField, object> ReadRow(Entity entity, MySqlDataReader reader)
        {
            Dictionary <EntityField, object> fieldValues = new Dictionary <EntityField, object>();

            for (int i = 0; i < entity.Resource.All.Count; i++)
            {
                EntityField field = entity.Resource.All[i];
                object      value = reader.GetValue(i);
                fieldValues[field] = MySqlTypeConverter.Convert(field, value);
            }
            return(fieldValues);
        }
        internal override void Delete(Entity entity, List <EntityField> fields, object[] values)
        {
            CurrentOperation = DatabaseOperation.DELETE;
            MySqlCommand command = GetMySqlCrudCommand(entity).GetDeleteCommand(fields);

            command.Transaction = Transaction;

            for (int i = 0; i < values.Length; i++)
            {
                command.Parameters[i].Value = MySqlTypeConverter.Convert(fields[i], values[i]);
            }

            try
            {
                command.ExecuteNonQuery();
            }
            catch (Exception exc)
            {
                Transaction.Rollback();
            }
        }