Private collection mapping in fluent nhibernate

前端 未结 3 429
日久生厌
日久生厌 2020-12-17 01:22

How can I map this:

public class Customer
{
   private IList _orders;
   public IEnumerable 
   GetAllOrders()
   {
      return _o         


        
3条回答
  •  天涯浪人
    2020-12-17 01:47

    Thanks. Your solution is fine. However, there could be situations(hypotetical) when you dont want to reveal your private collection. This mapping scenario is not explained in your linked post because there is difference between mapping simple propertie as descibed in that post and collection mapping. My attempt to use HasMany(x => Reveal.Propertie("_orders")) failed because of raised exception.

提交回复
热议问题