private bool TryBasicFactories <T>(Type type, string adapterRoleName, Func <IAdapterFactory, T> func, out T result)
        {
            var roleAsm = AdapterFactory.GetAssemblyThatDefines(adapterRoleName);

            if (roleAsm == null)
            {
                throw RuntimeFailure.AdapterRoleNotDefined("adapterRoleName", adapterRoleName);
            }
            // Try assembly factory, factory where the role is defined, then provider factories
            var asm = AdapterFactory.FromAssembly(type.GetTypeInfo().Assembly) ?? AdapterFactory.Null;

            result = func(asm);
            if (result != null)
            {
                return(true);
            }

            result = func(AdapterFactory.FromAssembly(roleAsm));
            if (result != null)
            {
                return(true);
            }

            // Exclude self, otherwise would be recursive
            var right = App.GetProviders <IAdapterFactory>().Where(t => t != this);

            foreach (var m in right)
            {
                result = func(m);
                if (result != null)
                {
                    return(true);
                }
            }

            return(false);
        }