I knew I was making some kind of bone-headed mistake.... For anyone who is interested, the test I gave before will never pass.
For reference, here is the test: var fromSession = session.Get<PricingStratey>(PricingStrategy.FullStock.Id<http://pricingstrategy.fullstock.id/> ); Console.WriteLine(object.ReferenceEquals(fromSession, PricingStrategy.FullStock); // prints false This will always print false because the PricingStrategy class is not mapped as an IUserType, the Product.PricingStrategy *property* is mapped as an IUserType. Duh. Here is an amended test that works. var fromSession = session.Get<Product>(1); Console.WriteLine(object.ReferenceEquals(fromSession.PricingStrategy, PricingStrategy.FullStock); // prints true FWIW, I really wish there were a way to say that the PricingStrategy class itself should be mapped with an IUserType instead of having to mark all properties as using the IUserType. I think being able to mark specific properties is useful in certain cases too, it would just be nice to have a global default. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/9u24iVBEZewJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
