Greg,
I guess you're right. We've solved this using an Intercepter in the Class itself like
public override void InitEntity(InitEntityCommand initEntityCommand)
{
base.InitEntity(initEntityCommand);
switch (initEntityCommand)
{
case InitEntityCommand.Load:
case InitEntityCommand.Create:
InitLastNameInterceptor();
break;
default:
break;
}
}
private bool m_LastNameInterceptorInitialized = false;
/// <summary>
/// Initialize an interceptor for Name property of LastName to set the FullName property on Person
/// </summary>
private void InitLastNameInterceptor()
{
// Prevent more than 1 initialization of the Interceptor
if (!m_LastNameInterceptorInitialized)
{
PropertyInterceptorAction nameAction = new PropertyInterceptorAction<DataEntityPropertySetInterceptorArgs<DomainModel.LastName, String>>(
typeof(DomainModel.LastName),
DomainModel.LastName.EntityPropertyNames.Name,
PropertyInterceptorMode.AfterSet,
NameSetter);
PropertyInterceptorManager.CurrentInstance.AddAction(nameAction);
m_LastNameInterceptorInitialized = true;
}
}
/// <summary>
/// Is called when the interceptor for Name in LastName is fired.
/// </summary>
/// <param name="args"></param>
private void NameSetter(DataEntityPropertySetInterceptorArgs<DomainModel.LastName, String> args)
{
SetFullName();
}