my is not a real need, my target is to don't explicity set the
dicriminator-value on every xml node of subclasses becouse i'm
lazy :)
in my case my subclasses are in the form
[MyAttribute('NameOfA")]
class SubClassA : Base { }
[MyAttribute('NameOfB")]
class SubClassB : Base { }
where MyAttribute is an attribute that i put on Base implementation
for other purpose but wich has a property Name.
anyhow nhibernate is great also becouse it has hundred of place where
we can inject custom logic so i'm asking if exist also a point where i
can inject a custom strategy to get the discriminator-value when is
not set in the xml file (
(i think to samething as
interface IDiscriminatorValueGenerator
{
object GetDiscriminatorValue(object entity)
}
)
note: the motivation is not only to write less xml; at the moment we
are already choosing if we will use as discriminator-value the class
name or the Name property taken from the attribute MyAtt., so if i can
make 2 implementation of IDiscriminatorValueGenerator and in the
future we change the strategy we must only change the type of the
implementation without rewriting all the discriminator-value
attributes)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---