Example #1
0
 public void Visit(RegistrationEvents events)
 {
     events.OrderSubmitted += args =>
     {
         Console.WriteLine(
             $"{args.PlayerName}, you are now registered with National Soccer Association");
         return(Task.CompletedTask);
     };
 }
        public void Visit(RegistrationEvents events)
        {
            //events.OrderSummited += args => Console.WriteLine($"Hello {args.PlayerName}. You are the best player in the world");

            events.OrderSubmitted +=
                async args => await Task.Run(
                    () => Console.WriteLine(
                        $"Hello {args.PlayerName}. You are the best player in the world"));
        }
Example #3
0
        public void Visit(RegistrationEvents events)
        {
            events.VolunteerRegistered += args =>
            {
                args.Volunteers.ToList().ForEach(x => Console.WriteLine(
                                                     $"Hello {x.Name}, we are submitting your information to National Soccer Association.\n Your position will be {x.VolunteerPosition}."));

                return(Task.CompletedTask);
            };
        }