Example #1
0
        public QueryResult Invoke(Query query)
        {
            Console.WriteLine("Query Received: {0}", query.GetType().Name);

            var handlerType = (typeof(IHandleQuery<>)).MakeGenericType(query.GetType());

            var handler = IoC.Resolve(handlerType);

            var result = (QueryResult)handler.GetType().GetMethod("Handle").Invoke(handler, new[] { query });

            return result;
        }
Example #2
0
 public QueryResult SendQuery(Query query)
 {
     return IoC.Resolve<QueryInvoker>().Invoke(query);
 }