NHibernate Lazy=“Extra”

后端 未结 3 1302
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 13:08

Is there a good explanation out there on what exactly lazy=\"extra\" is capable of?

All the posts I\'ve seen all just repeat the fact that it turns references to

3条回答
  •  悲&欢浪女
    2020-12-10 13:35

    Just tried calling Any() on a Collection Customer.Orders mapped with lazy="extra"

    customer.Orders.Any()
    

    and the resulting SQL statement looked something like this (simplified):

    SELECT *
    FROM Order
    WHERE CustomerId = 120
    

    Whereas when calling

    customer.Orders.Count > 0
    

    the resulting SQL looked like this:

    SELECT count(*)
    FROM Order
    WHERE CustomerId = 120
    

提交回复
热议问题