多対多の関係がありますが、列に特定のデータがある 1 つの行のみに制限する必要があります。
これは関係です:
「Product_Type」エンティティで、「Label」フィールドをエンティティ内にあるかのようにマップする必要があります。
CultureCode=System.Threading.Thread.CurrentThread.CurrentCulture.Name.Substring(0, 2).ToUpper() の「Product_Type_Culture」データをフィルタリングして、その中に 1 行だけを表示し、「Product_Type」のラベルをマップするにはどうすればよいですか実在物 ??
私はすでにセッションeccでフィルターを作成しました...
これは私の「失礼な」間違ったマッピングです。
public class Product_TypeMap : ClassMapping<Product_Type>
{
public Product_TypeMap()
{
Id(x => x.Id, m => m.Column("Id"));
Bag(x => x.Label, c =>
{
Table("Product_Type_Culture");
c.Key(k =>
{
k.Column("ProductTypeId");
});
c.Filter("cultureFilter", f => f.Condition("CultureCode = :cultureId"));
}, r => r.ManyToMany(m =>
{
m.Class(typeof(Product_Type_Culture));
m.Column("CultureCode");
}));
}
}
ありがとうございました!