3
にマップされているかどうかを見つけることはプロパティは、フィールドにマップされているかどうかを確認するにはどのような方法があります。 私は、これは、「検索のような一般的な」のようなものを生成したいと思います:私はNHibernateのにマップされていないプロパティを追加NHibernateは:プロパティは、フィールド
string[] words.
words = search.Split(' ');
Type type = typeof(T);
Disjunction disjunction = new Disjunction();
foreach (System.Reflection.PropertyInfo property in type.GetProperties())
{
if ((property.PropertyType == typeof(string)))
{
foreach (string word in words)
{
disjunction.Add(
Expression.InsensitiveLike(
property.Name,
"%" + word + "%"));
}
}
}
場合の検索は、プロパティを解決できませんでした」の説明をNHibernate.QueryExceptionをスローします:のテキスト1:C」
私はこのような性質をマッピングしています:
class C
{
[Property(0, Column = "comment")]
public virtual string Comment {get; set;}
}
ソリューションが働いていること、ありがとうございます! – bernhardrusch