I guess you would do this in the tuplizer, because IIRC you have access to
the data used to populate the entity at that point. So couldn't you do
something like:

var income = data[incomePropertyIndex];
var contributionsCalculator = income > 50000 ?
IoC.Resolve<IHighContributionRateCalculator>() :
IoC.Resolve<ILowContributionRateCalculator>();
var instance = IoC.Resolve<IAccount>(contributionsCalculator);

.....ish

2008/11/26 Fabio Maulo <[EMAIL PROTECTED]>

> 2008/11/26 Tuna Toksöz <[EMAIL PROTECTED]>
>
>> Can we inject a service depending on a property value for an entity? I am
>> not sure if that would be useful, but definitely this feature you blogged is
>> a good way of seperation of concern.
>
>
> NH is a very good persistence layer and can resolve persistence layer
> matters, intending to be less invasive as possible but... NH can't resolve
> every things.
>
> --
> Fabio Maulo
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to