Business rules with lower priority (-10) being called/added #3366
Unanswered
Chicagoan2016
asked this question in
Questions
Replies: 3 comments 1 reply
-
Now all this is related to #3361 :) private IPropertyInfo DepartmentName { get; set; }
public DepartmentExistsforEmployee(IPropertyInfo primaryProperty, IPropertyInfo departmentname)
: base(primaryProperty)
{
InputProperties.Add(PrimaryProperty);
InputProperties.Add(departmentname);
//If I change the above line to
// InputProperties.Add(DepartmentName);
// I am getting the errors mentioned in #3365
} The above rule is inherited from CommonBusinessRule |
Beta Was this translation helpful? Give feedback.
0 replies
-
I suppose I read it wrong, This is @jonnybee 's code public LessThan(IPropertyInfo primaryProperty, IPropertyInfo compareToProperty)
: base(primaryProperty)
{
CompareTo = compareToProperty;
InputProperties = new List<IPropertyInfo>() { primaryProperty, compareToProperty };
this.RuleUri.AddQueryParameter("compareto", compareToProperty.Name);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
The data portal should not be involved in the creation of a rule object. If |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is related to #3365
We have assigned priorities to business rules, we don't set ProcessThroughPriority in our code.
I have two rules, one rule (EmployeeIDgreaterzero) with priority of -10 checks that EmployeeID is greater than zero (EmploeeID being an int property).
If not, it calls context.AddErrorResult with a error message something like this
The other rule has priority of 0 and takes two properties, EmployeeID and departmentname.
We named the rule as DepartmentexistsforEmployee.
The DepartmentName is string property with default of String.Empty (we provide the default value in declaration, csla property syntax).
When this line is reached in AddBusinessRules
It causes the
base.DataPortal_Create() to throw exception of null object as discussed in #3365
Beta Was this translation helpful? Give feedback.
All reactions