/// <summary> /// Liest alle Beziehungen zu der Entität 'Schnittstelle' aus der Datenbank /// </summary> /// <param name="entity">Die Festplatte, zu welcher die Schnittstellen ermittelt werden</param> /// <returns>Liste von PhysicalInterfaceWithCount</returns> private List<PhysicalInterfaceWithCount> GetPhysicalInterfaces(Disk entity) { List<PhysicalInterfaceWithCount> physicalInterfaces = new List<PhysicalInterfaceWithCount>(); PhysicalInterfaceDataAccess physicalInterfaceDataAccess = new PhysicalInterfaceDataAccess(); MySqlConnection connection = this.CreateConnection(); MySqlCommand command = connection.CreateCommand(); command.CommandText = "SELECT * FROM `" + this.GetTableName() + "_schnittstelle` WHERE id_festplatte = " + entity.Id; connection.Open(); MySqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { PhysicalInterface physicalInterface = physicalInterfaceDataAccess.GetEntityById<PhysicalInterface>(Int32.Parse(reader.GetValue(1).ToString())); uint count = uint.Parse(reader.GetValue(2).ToString()); physicalInterfaces.Add(new PhysicalInterfaceWithCount(physicalInterface, count)); } return physicalInterfaces; }