<commit_before>﻿namespace MediatR.Examples.Unity
{
    using System;
    using System.Linq;
    using Microsoft.Practices.ServiceLocation;
    using Microsoft.Practices.Unity;

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

            Runner.Run(mediator, Console.Out);

            Console.ReadKey();
        }

        private static IMediator BuildMediator()
        {
            var container = new UnityContainer();
            container.RegisterTypes(AllClasses.FromAssemblies(typeof (IMediator).Assembly), WithMappings.FromAllInterfaces);
            container.RegisterTypes(AllClasses.FromAssemblies(typeof(Ping).Assembly), WithMappings.FromAllInterfaces, GetName, GetLifetimeManager);
            container.RegisterInstance(Console.Out);

            var serviceLocator = new UnityServiceLocator(container);
            var serviceLocatorProvider = new ServiceLocatorProvider(() => serviceLocator);
            container.RegisterInstance(serviceLocatorProvider);

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

            return mediator;
        }

        static bool IsNotificationHandler(Type type)
        {<commit_msg>Adding in the unity generic handler (https://unity.codeplex.com/workitem/12770)<commit_after>﻿namespace MediatR.Examples.Unity
{
    using System;
    using System.Linq;
    using Microsoft.Practices.ServiceLocation;
    using Microsoft.Practices.Unity;

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

            Runner.Run(mediator, Console.Out);

            Console.ReadKey();
        }

        private static IMediator BuildMediator()
        {
            var container = new UnityContainer();
            container.RegisterTypes(AllClasses.FromAssemblies(typeof (IMediator).Assembly), WithMappings.FromAllInterfaces);
            container.RegisterTypes(AllClasses.FromAssemblies(typeof(Ping).Assembly), WithMappings.FromAllInterfaces, GetName, GetLifetimeManager);
            container.RegisterType(typeof(INotificationHandler<>), typeof(GenericHandler), GetName(typeof(GenericHandler)));
            container.RegisterInstance(Console.Out);

            var serviceLocator = new UnityServiceLocator(container);
            var serviceLocatorProvider = new ServiceLocatorProvider(() => serviceLocator);
            container.RegisterInstance(serviceLocatorProvider);

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

            return mediator;
        }

        static bool IsNotificationHandler(Type type)
        {
{'fraction_non_alphanumeric': 0.08661417322834646, 'fraction_numerical': 0.0018747656542932134, 'mean_word_length': 2.838848920863309, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 1, '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': '1351234', 'n_tokens_mistral': 680, 'n_tokens_neox': 641, 'n_words': 127}