Skip to content

Instantly share code, notes, and snippets.

@jindeveloper
Created August 21, 2020 06:48
Show Gist options
  • Save jindeveloper/14153bed21dac2c4b9a6f51b22e863cb to your computer and use it in GitHub Desktop.
Save jindeveloper/14153bed21dac2c4b9a6f51b22e863cb to your computer and use it in GitHub Desktop.
[Fact]
public void Test_GetAll_BuiltIn_Attributes()
{
var assembly = Assembly.Load(assemblyFullName);
var attributes = assembly
.DefinedTypes
.Where(type =>
type
.IsSubclassOf(typeof(Attribute)));
foreach (var attribute in attributes)
{
string attr = attribute
.Name
.Replace("Attribute", "");
this._output
.WriteLine("Attribute: {0} and Usage: [{1}]"
, attribute.Name, attr);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment