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

            IList <IOrganiser> existingOrganisers = data.ReadAllOrganisers();

            IDictionary <string, string> organiserDetails = new Dictionary <string, string>
            {
                { "LCBA", "LCBA" },
                { "CBC", "County Bridge Club" },
                { "BRADGATE", "Bradgate Bridge Club" },
                { "GLENFIELD", "Glenfield Bridge Club" },
                { "CBT", "Charnwood Bridge Teachers" }
            };

            foreach (KeyValuePair <string, string> organiserDetail in organiserDetails)
            {
                if (existingOrganisers.Any(o => o.Code == organiserDetail.Key))
                {
                    continue;
                }

                IOrganiser organiser = new Organiser(
                    id: Guid.NewGuid(),
                    code: organiserDetail.Key,
                    name: organiserDetail.Value);

                data.CreateOrganiser(organiser);
                Console.WriteLine($@"Seeding Dealer: {organiser.Name}.");
            }
        }