Hi all,
I am experiencing some strange problems with NHibernate and the usage of proxy items within a bag. My mapping looks something similar to:
<?xml version="1.0" encoding="utf-8" ?>
<bag name="Markets" table="ITPUserWatchlistMarkets" cascade="none" lazy="false">
<key column="UserWatchlistId" />
<many-to-many class="Swan.Domain.Markets.Market, Swan.Domain.Markets" column="MarketId" lazy="proxy" />
</bag>
To my understanding, by setting the many-to-many mapping as lazy="proxy", NHibernate should be creating a proxy object which is different to my Market type, with just the identity key in it and nothing else set on it.
However, when running through debug, I can actually see real Market entities being instantiated and added to the Markets bag, which should not be happening.
Is my mapping incorrect, or does NHibernate create actual entities rather than its own reflected type as the proxy object?
Regards, Alvaro