private static void SetupApplicationBuilder(IServiceCollection services, Action <JsonApiOptions> options,
                                                    Action <IServiceDiscoveryFacade> discovery,
                                                    Action <IResourceGraphBuilder> resources, IMvcCoreBuilder mvcBuilder, Type dbContextType)
        {
            var applicationBuilder = new JsonApiApplicationBuilder(services, mvcBuilder ?? services.AddMvcCore());

            applicationBuilder.ConfigureJsonApiOptions(options);
            applicationBuilder.ConfigureMvc(dbContextType);
            applicationBuilder.AutoDiscover(discovery);
            applicationBuilder.ConfigureResources(resources);
            applicationBuilder.ConfigureServices();
        }
        private static void SetupApplicationBuilder(IServiceCollection services, Action <JsonApiOptions> configureOptions,
                                                    Action <ServiceDiscoveryFacade> configureAutoDiscovery, Action <ResourceGraphBuilder> configureResourceGraph, IMvcCoreBuilder mvcBuilder,
                                                    ICollection <Type> dbContextTypes)
        {
            using var applicationBuilder = new JsonApiApplicationBuilder(services, mvcBuilder ?? services.AddMvcCore());

            applicationBuilder.ConfigureJsonApiOptions(configureOptions);
            applicationBuilder.ConfigureAutoDiscovery(configureAutoDiscovery);
            applicationBuilder.AddResourceGraph(dbContextTypes, configureResourceGraph);
            applicationBuilder.ConfigureMvc();
            applicationBuilder.DiscoverInjectables();
            applicationBuilder.ConfigureServiceContainer(dbContextTypes);
        }