Automatonymous.Tests.InterfaceExtensions.GetInterface C# (CSharp) Метод

GetInterface() публичный статический Метод

public static GetInterface ( this type, Type interfaceType ) : Type
type this
interfaceType System.Type
Результат System.Type
        public static Type GetInterface(this Type type, Type interfaceType)
        {
            if (type == null)
                throw new ArgumentNullException(nameof(type));
            if (interfaceType == null)
                throw new ArgumentNullException(nameof(interfaceType));

            var interfaceTypeInfo = interfaceType.GetTypeInfo();
            if (!interfaceTypeInfo.IsInterface)
                throw new ArgumentException("The interface type must be an interface: " + interfaceType.Name);

            return _cache.Get(type, interfaceType);
        }