if (serviceType.IsConstructedGenericType &&
serviceType.GetGenericTypeDefinition() == typeof(IEnumerable<>))
{
- var itemType = serviceType.GenericTypeArguments.Single();
+ var itemType = serviceType.GenericTypeArguments[0];
var cacheLocation = CallSiteResultCacheLocation.Root;
var callSites = new List<ServiceCallSite>();
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
namespace Microsoft.Extensions.DependencyInjection.Tests
private static Type FirstGenericArgument(Type type)
{
- return type.GetTypeInfo().GenericTypeArguments.Single();
+ return type.GetTypeInfo().GenericTypeArguments[0];
}
private static IList CreateEmptyList(Type innerType)