예제 #1
0
        // Problem 14 - First Letter
        private static void PrintFirstLetterOfWizardsWhoHaveDepositType(GringottsContext context, string depositType)
        {
            var letters = context.WizzardDeposits
                          .Where(w => w.DepositGroup == depositType)
                          .Select(w => w.FirstName.Substring(0, 1))
                          .Distinct();

            foreach (var letter in letters)
            {
                Console.WriteLine(letter);
            }
        }
예제 #2
0
        public static void Main()
        {
            GringottsContext context = new GringottsContext();

            PrintFirstLetterOfWizardsWhoHaveDepositType(context, "Troll Chest");
        }