<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Autofac;

namespace ServiceProvider.Autofac
{
    /// <summary>
    /// Service provider based on lifetime scope.
    /// </summary>
    public class AutofacServiceProvider : IServiceProvider
    {
        private readonly ILifetimeScope _scope;

        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceProvider"/> class.
        /// </summary>
        /// <param name="scope">The lifetime scope.</param>
        public ServiceProvider(ILifetimeScope scope)
        {
            _scope = scope;
        }

        /// <summary>
        /// Gets the service object of the specified type.
        /// </summary>
        /// <param name="serviceType">The type of resolved service object.</param>
        /// <returns>The instance of type <paramref name="serviceType"/>.</returns>
        object IServiceProvider.GetService(Type serviceType)
        {
            return _scope.Resolve(serviceType);
        }
    }
}<commit_msg>Update AutofacServiceProvider.cs<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Autofac;

namespace ServiceProvider.Autofac
{
    /// <summary>
    /// Service provider based on lifetime scope.
    /// </summary>
    public class AutofacServiceProvider : IServiceProvider
    {
        private readonly ILifetimeScope _scope;

        /// <summary>
        /// Initializes a new instance of the <see cref="AutofacServiceProvider"/> class.
        /// </summary>
        /// <param name="scope">The lifetime scope.</param>
        public AutofacServiceProvider(ILifetimeScope scope)
        {
            _scope = scope;
        }

        /// <summary>
        /// Gets the service object of the specified type.
        /// </summary>
        /// <param name="serviceType">The type of resolved service object.</param>
        /// <returns>The instance of type <paramref name="serviceType"/>.</returns>
        object IServiceProvider.GetService(Type serviceType)
        {
            return _scope.Resolve(serviceType);
        }
    }
}
{'fraction_non_alphanumeric': 0.11284046692607004, 'fraction_numerical': 0.0, 'mean_word_length': 2.2454417952314167, 'pattern_counts': {'":': 0, '<': 33, '<?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': '5105480', 'n_tokens_mistral': 582, 'n_tokens_neox': 578, 'n_words': 187}