ncommon

How to implement correctly IUserType?

一世执手 提交于 2019-12-17 11:27:30
问题 I need to create a custom type for NHibernate by writing a new mapper class that implements IUserType . While it is relatively straightforward to override most of the methods and properties, I get some difficulties to understand how to deal correctly with the following members: object Assemble(object cached, object owner); object DeepCopy(object value); object Disassemble(object value); object Replace(object original, object target, object owner); I do not understand what is exactly their

nHibernate Eager Loading at runtime

早过忘川 提交于 2019-12-11 15:23:45
问题 We're using NCommon's UnitOfWorkScope which wraps nHibernate ISession functionality. Our goal is to eager-load complex properties on demand vs. always eagerly loading them via configuration. The idea is that a given service that retrieves an entity can be customized a bit by the calling code - sometimes we want only the parent entity to be hydrated, other times we may want the complex child properties hydrated, too. To accomplish this, we're doing the following: var iSession = unitOfWorkScope

How to implement correctly IUserType?

我怕爱的太早我们不能终老 提交于 2019-11-27 14:19:01
I need to create a custom type for NHibernate by writing a new mapper class that implements IUserType . While it is relatively straightforward to override most of the methods and properties, I get some difficulties to understand how to deal correctly with the following members: object Assemble(object cached, object owner); object DeepCopy(object value); object Disassemble(object value); object Replace(object original, object target, object owner); I do not understand what is exactly their purpose; and more important, how to properly implement them. Most of the examples I have seen just return