==[[Tips]]==
===属性の指定と読み込み===
[https://docs.microsoft.com/ja-jp/dotnet/csharp/programming-guide/concepts/attributes/accessing-attributes-by-using-reflection リフレクションを使用した属性へのアクセス]
* 属性定義
<pre>
[System.AttributeUsage(System.AttributeTargets.Property)]
public class PrimaryKeyAttribute : System.Attribute
{
}
</pre>
*読み出し(Hogeクラスのプロパティに属性をつけているとする)
<pre>
var type = typeof(Hoge);
var properties = type.GetProperties();
foreach(var property in properties)
{
foreach(var attr in property.GetCustomAttributes(true))
{
Console.WriteLine($"[{attr}]");
}
Console.WriteLine($"{property.Name}");
}
</pre>
===Docコメント===
https://docs.microsoft.com/ja-jp/dotnet/csharp/language-reference/xmldoc/recommended-tags