読み取り専用プロパティで使用する.CheckProperty
場合は使用できますか?PersistenceSpecification
たとえば、プロパティを設定するメソッドUsed
として、読み取り専用プロパティを持つクラス:SetAsUsed
public class MyClass
{
public virtual int Id { get; set; }
public virtual string Code { get; set; }
public virtual DateTime? Used { get; private set; }
public virtual void SetAsUsed()
{
Used = DateTime.Now;
}
}
次のような永続化仕様を作成したいと思います。
new PersistenceSpecification<ForgotPasswordRequest>(Session)
.CheckProperty(x => x.Code, "a@b.com")
.CheckProperty(x => x.Used, //??
.VerifyTheMappings();
しかし、ここからメソッドを呼び出す方法がわかりませんかSetAsUsed
?