using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.AspNet.CoreServices
{
///
/// The default IServiceProvider.
///
public class ServiceProvider : IServiceProvider
{
private readonly IDictionary> _services = new Dictionary>();
private readonly IDictionary>> _priorServices = new Dictionary>>();
///
///
///
public ServiceProvider()
{
_services[typeof(IServiceProvider)] = () => this;
}
///
/// Gets the service object of the specified type.
///
///
///
public virtual object GetService(Type serviceType)
{
return GetSingleService(serviceType) ?? GetMultiService(serviceType);
}
private object GetSingleService(Type serviceType)
{
Func