Exemplo n.º 1
0
        private Type GetCommandHandlerType(Type handlerInheritingFromType)
        {
            var commandHandlerType = _assembliesListProvider
                                     .GetAssemblies()
                                     .SelectMany(x => x.GetTypes())
                                     .SingleOrDefault(x => x.GetInterfaces().Any(y => y == handlerInheritingFromType));

            return(commandHandlerType);
        }
Exemplo n.º 2
0
 private Type GetCommandHandlerType(Type handler)
 {
     return(_assembliesListProvider
            .GetAssemblies().SelectMany(x => x.DefinedTypes)
            .SingleOrDefault(x => x.GetTypeInfo().ImplementedInterfaces.Any(y => y == handler)));
 }