Ejemplo n.º 1
0
        /// <summary>
        /// implementiert die Anforderung LIST(Suppliers) findAllPreferredSuppliers()
        /// </summary>
        /// <returns> eine Liste von Supplier, die mindestens einen Eintrag in preferredSupplier haben </returns>
        public List <Supplier> findAllPreferredSuppliers()
        {
            List <Supplier> result      = new List <Supplier>();
            var             allProducts = _supplierContext.Product;

            foreach (Product p in allProducts)
            {
                Supplier s = _supplierContext.Find <Supplier>(p.preferredSupplier);
                if (!result.Contains(s))
                {
                    result.Add(s);
                }
            }
            return(result);
        }