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