public static IGenericSearchServicesBuilder AddGenericSearch(this IServiceCollection services, params Assembly[] assemblies)
        {
            var builder = new GenericSearchServicesBuilder(services);

            foreach (var assembly in assemblies)
            {
                builder.AddProfilesFromAssembly(assembly);
            }

            return(builder);
        }
        public void AddProfilesFromAssembly_Assembly_Succeeds()
        {
            var services = new ServiceCollection();

            var builder = new GenericSearchServicesBuilder(services);

            builder.AddProfilesFromAssembly(GetType().Assembly);

            var service = services.Single(x => x.ServiceType == typeof(IListDefinitionSource));

            service.ImplementationType.Should().Be <ProfileBaz>();
        }
        public static IGenericSearchServicesBuilder AddDefaultGenericSearch(this IServiceCollection services, Action <GenericSearchOptions> configureOptions, params Assembly[] assemblies)
        {
            var builder = new GenericSearchServicesBuilder(services)
                          .AddDefaultServices()
                          .AddDefaultActivators()
                          .AddModelBinder()
                          .AddTransferValuesActionFilter()
                          .AddPostRedirectGetActionFilter()
                          .ConfigureOptions(configureOptions);

            foreach (var assembly in assemblies)
            {
                builder.AddProfilesFromAssembly(assembly);
            }

            return(builder);
        }