私はたくさんのエンティティクラスを持っています、そして今、エンティティクラスのすべてのプロパティでゲッターとセッターに新しい機能を追加する必要があります(いくつかのメソッドを呼び出します)。私が言いたいことは次のようになります:
public class PersistentClass : BaseClass {
private string attr1;
[Persistent]
public string Attr1
{
get
{
//need to call here base class method
//refreshContents();
return attr1;
}
set
{
//need to call here base class method
//refreshContents();
attr1 = value;
}
}
private SomeObject attr2;
[Persistent]
public SomeObject Attr2
{
get
{
//need to call here base class method
//refreshContents();
return attr2;
}
set
{
//need to call here base class method
//refreshContents();
attr2 = value;
}
}
private List<SomeOtherObhect> details;
[Persistent]
pubic List<SomeOtherObject> Details
{
get
{
//need to call here base class method
//refreshContents("details");
return details;
}
set
{
//need to call here base class method
//refreshContents("details");
details = value;
}
}
}
さまざまなタイプのフィールドについて、さまざまなメソッドを呼び出す必要がありrefreshContents()
ますrefreshContetns("fieldName")
。IoCと依存性注入の問題を解決しようとしています。私を手伝ってくれますか?