Normal 0 21 false false false IS X-NONE X-NONE
*** update ***
ahhhh, of course ... I forgot the target.Parent :-)
************************************************************
In CSLA 3.8:
Could you please tell me how I can reference this.Parent from a Business Rule ( as I understand it … all business rules must be static )
I can also NOT use this.Parent ( of course! ) inside the static rule itself … how would you implement this ?
private LogoutProcessManager GetParent()
{
IParent parent = this.Parent;
return (LogoutProcessManager) parent;
}
private static bool RealmRule<T>(T target, RuleArgs e) where T : WebClientInformation
{
LogoutProcessManager parent = GetParent(); // this will not work, because because the GetParent uses this.XXXXX but the business rule is static
LogoutProcessState logoutProcessState = parent.CurrentState;
if (string.IsNullOrEmpty(target.Realm) && logoutProcessState != LogoutProcessState.Initialized)
{
e.Description = BusinessResources.RealmMissing;
e.Severity = RuleSeverity.Error;
return false;
}
return true;
}
Thanx in advance,
Quoted your text in the question to
1) Highlight that this is the answer, as I just about finished my post before I noticed you didn't need an answer
and
2) not leave the question unanswered
Copyright (c) Marimer LLC