예제 #1
0
        static async Task Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(
                new UserValidationService(new MyServiceAdapter()),
                new CampaignManager(),
                new SalesManager(),
                new Game {
                Id = 1, GameName = "GTA5", UnitPrice = 200
            },
                new Campaign {
                Id = 1, CampaignName = "Muhteşem Cuma", DiscountRate = 7
            });

            gamerManager.Add(new Gamer {
                Id = 1, FirstName = "ONUR", LastName = "BUDAK", NationalityId = "123456", BirthYear = 1997
            });

            Console.WriteLine("-------------------------------------------------------------------------");

            await RemoteApiCall1();

            Console.WriteLine("-------------------------------------------------------------------------");

            await RemoteApiCall2();

            //Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer
            {
                Id          = 1,
                Name        = "Sümeyye",
                Surname     = "Kula",
                TcNo        = "1234560",
                DateOfBirth = 1997
            });
            Gamer gamer2 = new Gamer
            {
                Id          = 2,
                Name        = "Ahmet",
                Surname     = "Yılmaz",
                TcNo        = "12345",
                DateOfBirth = 1996
            };
            GamerManager gamerManager2 = new GamerManager(new UserValidationManager());

            gamerManager.Add(gamer2);

            Campaign campaign1 = new Campaign
            {
                Id   = 1,
                Name = "Campaign1"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.add(campaign1);

            Game game1 = new Game()
            {
                Id = 1, Name = "Game1", Price = 28
            };
            ISaleService sale = new SaleManager();

            sale.CampaignSale(campaign1, game1, gamer2);
        }