public static IMvcCoreBuilder AddWebApiProxyServer(this IMvcCoreBuilder mvcBuilder) { var webApiProxyTypes = AppDomain.CurrentDomain.GetExcutingAssembiles().SelectMany(x => x.GetTypes()) .Where(x => !x.IsAbstract && typeof(WebApiProxy).IsAssignableFrom(x)); mvcBuilder.AddWebApiProxyServer(opt => { foreach (var type in webApiProxyTypes) { opt.AddWebApiProxy(type, ""); } }); return(mvcBuilder); }