Exemplo n.º 1
0
        /// <inheritdoc/>
        public void Dealers(ICaller caller)
        {
            using IDealData data = InstanceFactory.GetInstance <IDealData>();

            IList <IDealer> existingDealers = data.ReadAllDealers();

            IList <string> dealerNames = new List <string>
            {
                "Steve",
                "Anne"
            };

            foreach (string dealerName in dealerNames)
            {
                if (existingDealers.Any(d => d.Name == dealerName))
                {
                    continue;
                }

                IDealer dealer = new Dealer(
                    id: Guid.NewGuid(),
                    name: dealerName);

                data.CreateDealer(dealer);
                Console.WriteLine($@"Seeding Dealer: {dealerName}.");
            }
        }