属性を抽出しようとしています。属性はカスタム属性です。
しかし、どのように私は
object.id
物事を使用することができません。
たとえば、コメントされたコードadpter.id
は有効ではありません。そのオブジェクトをその型に変換したことがわかります。
属性のコードは次のとおりです。
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class Adapter : Attribute
{
// This class implements the Adapter Attribite
readonly int id;
readonly string Title;
public string Comment { get; set; }
private string[] Relation;
public Adapter(int id, string Title,string []relations)
{
this.id = id;
this.Title = Title;
this.Relation = relations;
}
}