Exemple #1
0
        private static void PrintCollectionToConsole(Boksamling boksamling)
        {
            if (CollectionIsNullOrEmpty(boksamling))
            {
                Console.WriteLine("Boksamlingen innehåller inga element");
                return;
            }

            foreach (var bok in boksamling.bok)
            {
                Console.WriteLine(bok.titel + " - " + bok.pris + " kr");
            }
        }
Exemple #2
0
 private static bool CollectionIsNullOrEmpty(Boksamling boksamling)
 {
     return(boksamling == null ||
            boksamling.bok == null ||
            boksamling.bok.Length == 0);
 }