Source

WebActivator / WebActivator / AssemblyExtensions.cs

davidebbo f529d2d 
davidebbo ca25998 


davidebbo fb99ee3 



davidebbo f529d2d 
davidebbo fb99ee3 

davidebbo ca25998 
davidebbo f529d2d 

davidebbo ca25998 

using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace WebActivator
{
    static class AssemblyExtensions
    {
        // Return all the attributes of a given type from an assembly
        public static IEnumerable<T> GetActivationAttributes<T>(this Assembly assembly) where T : BaseActivationMethodAttribute
        {
            return assembly.GetCustomAttributes(
                typeof(T),
                inherit: false).OfType<T>();
        }
    }
}