Bifrost.FluentValidation.Commands.CommandValidatorProvider.GetGenericParameterType C# (CSharp) Method

GetGenericParameterType() private method

private GetGenericParameterType ( Type typeToQuery, Type genericInterfaceType ) : Type
typeToQuery System.Type
genericInterfaceType System.Type
return System.Type
        Type GetGenericParameterType(Type typeToQuery, Type genericInterfaceType)
        {
            return (from @interface in typeToQuery.GetInterfaces() 
                    where @interface.IsGenericType && @interface.GetGenericTypeDefinition() == genericInterfaceType 
                    select @interface.GetGenericArguments()[0]).FirstOrDefault();
        }
    }