Probably possible with PostSharp, but I'm not too sure.
with PostSharp and Cecil.But a lot of work to do and everybody should use Postsharp.payment = loadedPayment as ICreditCard;if (payment != null){.....}In the mapping you can use the interface as proxy.Another option is disable lazy loading (lazy="false") for that specific class.Another isvar cc = session.Get<CreditCard>(payment.Id);Obviously I preferProgram to interface not to implementation
> But a lot of work to do and everybody should use Postsharp.
Well. I would say only those who wants to. Almost the same way as they
should ByteCode.LinFu, Spring or any other.
> payment = loadedPayment as ICreditCard;
How this casting is different from "laodedPayment as CreditCard" or
"laodedPayment is CreditCard"in terms of working with proxy?
Are you saying that we have to write interfaces for all the business
objects (at least those we need lazy loading to be enabled for)?
Cheers.