private IEnumerable <(MethodInfo, CommandHandlerAttribute, Type)> ResolveHandlers() { var type = CommandContainer.GetType(); foreach (var method in type.GetMethods()) { if (method.GetCustomAttribute <CommandHandlerAttribute>() is CommandHandlerAttribute attr) { var parser = method.GetCustomAttribute <CommandParserAttribute>()?.Parser ?? typeof(DefaultParser); yield return(method, attr, parser); } } }