このブログ投稿 ( http://marekblotny.blogspot.com/2009/04/conventions-after-rewrite.html ) で見たパターンが気に入っています。ここでは、テーブル名の変更が既に行われているかどうかを著者がチェックしています。規則を適用する前に。
public bool Accept(IClassMap target)
{
//apply this convention if table wasn't specified with WithTable(..) method
return string.IsNullOrEmpty(target.TableName);
}
文字列の長さに使用している規約インターフェイスは IProperty です。
public class DefaultStringLengthConvention: IPropertyConvention
{
public bool Accept(IProperty property) {
//apply if the string length hasn't been already been specified
return ??; <------ ??
}
public void Apply(IProperty property) {
property.WithLengthOf(50);
}
}
IProperty が、プロパティが既に設定されているかどうかを示す情報を公開している場所がわかりません。これは可能ですか?
ティア、ベリル