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, Type dbContextType)
        {
            using var applicationBuilder = new JsonApiApplicationBuilder(services, mvcBuilder ?? services.AddMvcCore());

            applicationBuilder.ConfigureJsonApiOptions(configureOptions);
            applicationBuilder.ConfigureAutoDiscovery(configureAutoDiscovery);
            applicationBuilder.AddResourceGraph(dbContextType, configureResourceGraph);
            applicationBuilder.ConfigureMvc();
            applicationBuilder.DiscoverInjectables();
            applicationBuilder.ConfigureServices(dbContextType);
        }