MVC Get Attributes

Assembly assembly = Assembly.GetExecutingAssembly();
IEnumerable<Type> types = assembly.GetTypes()
	.Where(
		type =>
			typeof(Controller).IsAssignableFrom(type) &&
			type.Name.Replace("Controller", "") == controllerName)
	.OrderBy(x => x.Name);

foreach (Type cls in types)
{                
	HelpAttribute helpAttribute = Attribute.GetCustomAttribute(cls, typeof(HelpAttribute)) as HelpAttribute;
	url = helpAttribute != null ? helpAttribute.Url : string.Empty;
	........
}

 

Bunlar da hoşunuza gidebilir...