Exemple #1
0
        static void Main(string[] args)
        {
            AMediator aMediator = new AMediator();

            RegisterPersonHandler(aMediator);

            //TODO: Request Bob

            Helper.PrintResult("Bob", null /*TODO: Insert result object*/);

            //TODO: Request Peter

            Helper.PrintResult("Peter", null /*TODO: Insert result object*/);
        }
Exemple #2
0
        private static void RegisterPersonHandler(AMediator amediator)
        {
            Dictionary <string, Person> allPersons = new Dictionary <string, Person>
            {
                ["Bob"] = new Person()
                {
                    Name = "Bob", Email = "*****@*****.**", Age = 35
                },
            };

            amediator.RegisterHandler((PersonRequest x) =>
            {
                // TODO: Implement handler logic
                return(new PersonResponse(null));
            });
        }