<commit_before>﻿namespace MediatR.Examples.StructureMap
{
    using System;
    using System.IO;
    using global::StructureMap;
    using Microsoft.Practices.ServiceLocation;

    class Program
    {
        static void Main(string[] args)
        {
            var mediator = BuildMediator();

            Runner.Run(mediator, Console.Out);
        }

        private static IMediator BuildMediator()
        {
            var container = new Container(cfg =>
            {
                cfg.Scan(scanner =>
                {
                    scanner.AssemblyContainingType<Ping>();
                    scanner.AssemblyContainingType<IMediator>();
                    scanner.WithDefaultConventions();
                    scanner.AddAllTypesOf(typeof (IRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IAsyncRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IPostRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IAsyncPostRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (INotificationHandler<>));
                    scanner.AddAllTypesOf(typeof (IAsyncNotificationHandler<>));
                });
                cfg.For<TextWriter>().Use(Console.Out);
            });

            var serviceLocator = new StructureMapServiceLocator(container);
            var serviceLocatorProvider = new ServiceLocatorProvider(() => serviceLocator);
            container.Configure(cfg => cfg.For<ServiceLocatorProvider>().Use(serviceLocatorProvider));

            var mediator = container.GetInstance<IMediator>();

            return mediator;
        }
    }
}<commit_msg>Slight tweak to structuremap example<commit_after>﻿namespace MediatR.Examples.StructureMap
{
    using System;
    using System.IO;
    using global::StructureMap;
    using Microsoft.Practices.ServiceLocation;

    class Program
    {
        static void Main(string[] args)
        {
            var mediator = BuildMediator();

            Runner.Run(mediator, Console.Out);
        }

        private static IMediator BuildMediator()
        {
            var container = new Container(cfg =>
            {
                cfg.Scan(scanner =>
                {
                    scanner.AssemblyContainingType<Ping>();
                    scanner.AssemblyContainingType<IMediator>();
                    scanner.WithDefaultConventions();
                    scanner.AddAllTypesOf(typeof (IRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IAsyncRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IPostRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (IAsyncPostRequestHandler<,>));
                    scanner.AddAllTypesOf(typeof (INotificationHandler<>));
                    scanner.AddAllTypesOf(typeof (IAsyncNotificationHandler<>));
                });
                cfg.For<TextWriter>().Use(Console.Out);
            });

            var serviceLocator = new StructureMapServiceLocator(container);
            var serviceLocatorProvider = new ServiceLocatorProvider(() => serviceLocator);
            container.Configure(cfg => cfg.For<ServiceLocatorProvider>().Use(serviceLocatorProvider));

            var mediator = serviceLocator.GetInstance<IMediator>();

            return mediator;
        }
    }
}
{'fraction_non_alphanumeric': 0.09988038277511961, 'fraction_numerical': 0.0, 'mean_word_length': 2.0162308385933274, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5002356', 'n_tokens_mistral': 862, 'n_tokens_neox': 805, 'n_words': 128}