0
プロパティの代わりにメソッドにマップすることはできますか?FluentNHibernate:メソッドへのHasManyマッピング(そのバッキングフィールド)? /外部キーは保存されません
"GetOrders()" typeof "ReadOnlyCollection"のバッキングフィールド "_orders" typeof "IList"を持つCustomerクラスがあります。
私はCustomerMapで試してみました:
HasMany<Order>(Reveal.Member<Customer>("_orders"))
.KeyColumn("CustomerId").Cascade.All().Inverse().Not.LazyLoad();
しかし、1件のオーダーを含む顧客の挿入を実行しているとき、私は例外を取得。
Cannot insert the value NULL into column 'CustomerId', table 'Order';
column does not allow nulls. INSERT fails.
マッピング方法(または少なくともバッキングフィールド)は機能しませんか? ほかに何か間違っていますか?