Tracks the business rules for a business object.
More...
|
static void | AddRule (Type objectType, IAuthorizationRule rule) |
| Associates a per-type authorization rule with the business type in the default rule set. More...
|
|
static void | AddRule (Type objectType, IAuthorizationRule rule, string ruleSet) |
| Associates a per-type authorization rule with the business type. More...
|
|
static void | AddRule (ApplicationContext applicationContext, Type objectType, IAuthorizationRule rule, string ruleSet) |
| Associates a per-type authorization rule with the business type. More...
|
|
static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, Type objectType) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, Type objectType, object[] criteria) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, Type objectType, string ruleSet) |
| Checks per-type authorization rules. More...
|
|
static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, object obj) |
| Checks per-instance authorization rules. More...
|
|
static BrokenRulesTree | GetAllBrokenRules (object root) |
| Gets all nodes in tree that have IsValid = false (and all parents) More...
|
|
static BrokenRulesTree | GetAllBrokenRules (object root, bool errorsOnly) |
| Gets all nodes in tree that have broken rules. More...
|
|
Tracks the business rules for a business object.
Definition at line 24 of file BusinessRules.cs.
◆ BusinessRules() [1/2]
Csla.Rules.BusinessRules.BusinessRules |
( |
| ) |
|
◆ BusinessRules() [2/2]
Creates an instance of the type.
- Parameters
-
applicationContext | |
target | Target business object. |
Definition at line 38 of file BusinessRules.cs.
◆ AddDataAnnotations()
void Csla.Rules.BusinessRules.AddDataAnnotations |
( |
| ) |
|
Adds validation rules corresponding to property data annotation attributes.
Definition at line 913 of file BusinessRules.cs.
◆ AddRule() [1/6]
Associates a per-type authorization rule with the business type.
- Parameters
-
applicationContext | ApplicationContext instance |
objectType | Type of business object. |
rule | Rule object. |
ruleSet | Rule set name. |
Definition at line 231 of file BusinessRules.cs.
◆ AddRule() [2/6]
Associates an authorization rule with the business object.
- Parameters
-
Definition at line 194 of file BusinessRules.cs.
◆ AddRule() [3/6]
Associates a business rule with the business object.
- Parameters
-
Definition at line 174 of file BusinessRules.cs.
◆ AddRule() [4/6]
Associates a business rule with the business object.
- Parameters
-
rule | Rule object. |
ruleSet | Rule set name. |
Definition at line 184 of file BusinessRules.cs.
◆ AddRule() [5/6]
Associates a per-type authorization rule with the business type in the default rule set.
- Parameters
-
objectType | Type of business object. |
rule | Rule object. |
Definition at line 206 of file BusinessRules.cs.
◆ AddRule() [6/6]
static void Csla.Rules.BusinessRules.AddRule |
( |
Type |
objectType, |
|
|
IAuthorizationRule |
rule, |
|
|
string |
ruleSet |
|
) |
| |
|
static |
Associates a per-type authorization rule with the business type.
- Parameters
-
objectType | Type of business object. |
rule | Rule object. |
ruleSet | Rule set name. |
Definition at line 218 of file BusinessRules.cs.
◆ CachePermissionResult()
Gets a value indicating whether the permission result can be cached.
- Parameters
-
action | Authorization action. |
element | Property or method to check. |
Definition at line 435 of file BusinessRules.cs.
◆ CheckObjectRules()
List< string > Csla.Rules.BusinessRules.CheckObjectRules |
( |
| ) |
|
Invokes all rules attached at the class level of the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
Definition at line 519 of file BusinessRules.cs.
◆ CheckRules() [1/2]
List< string > Csla.Rules.BusinessRules.CheckRules |
( |
| ) |
|
Invokes all rules for the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
Definition at line 492 of file BusinessRules.cs.
◆ CheckRules() [2/2]
Invokes all rules for a specific property of the business type.
- Parameters
-
property | Property to check. |
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property.
- Exceptions
-
System.ArgumentNullException | If property is null |
Definition at line 587 of file BusinessRules.cs.
◆ CheckRulesAsync() [1/2]
async Task< List< string > > Csla.Rules.BusinessRules.CheckRulesAsync |
( |
| ) |
|
Invokes all rules for the business type.
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property. Does not return until all async rules are complete.
Definition at line 479 of file BusinessRules.cs.
◆ CheckRulesAsync() [2/2]
async Task< List< string > > Csla.Rules.BusinessRules.CheckRulesAsync |
( |
int |
timeout | ) |
|
Invokes all rules for the business type.
- Parameters
-
timeout | Timeout value in milliseconds |
- Returns
- Returns a list of property names affected by the invoked rules. The PropertyChanged event should be raised for each affected property. Does not return until all async rules are complete.
Definition at line 458 of file BusinessRules.cs.
◆ GetAllBrokenRules() [1/2]
static BrokenRulesTree Csla.Rules.BusinessRules.GetAllBrokenRules |
( |
object |
root | ) |
|
|
static |
Gets all nodes in tree that have IsValid = false (and all parents)
- Parameters
-
- Returns
- BrukenRulesTree list
Definition at line 1062 of file BusinessRules.cs.
◆ GetAllBrokenRules() [2/2]
static BrokenRulesTree Csla.Rules.BusinessRules.GetAllBrokenRules |
( |
object |
root, |
|
|
bool |
errorsOnly |
|
) |
| |
|
static |
Gets all nodes in tree that have broken rules.
- Parameters
-
root | The root. |
errorsOnly | if set to true will only return objects that gave IsValid = false. |
- Returns
Definition at line 1072 of file BusinessRules.cs.
◆ GetBrokenRules()
◆ GetPropertyBusy()
Gets a value indicating whether a specific property has any async rules running.
- Parameters
-
property | Property to check. |
Definition at line 316 of file BusinessRules.cs.
◆ GetRuleDescriptions()
string[] Csla.Rules.BusinessRules.GetRuleDescriptions |
( |
| ) |
|
Gets a list of rule:// URI values for the rules defined in the object.
- Returns
Definition at line 148 of file BusinessRules.cs.
◆ HasPermission() [1/5]
Checks per-property authorization rules.
- Parameters
-
applicationContext | |
action | Authorization action. |
element | Property or method to check. |
Definition at line 406 of file BusinessRules.cs.
◆ HasPermission() [2/5]
Checks per-instance authorization rules.
- Parameters
-
applicationContext | |
action | Authorization action. |
obj | Business object instance. |
Definition at line 373 of file BusinessRules.cs.
◆ HasPermission() [3/5]
Checks per-type authorization rules.
- Parameters
-
applicationContext | |
action | Authorization action. |
objectType | Type of business object. |
Definition at line 327 of file BusinessRules.cs.
◆ HasPermission() [4/5]
Checks per-type authorization rules.
- Parameters
-
applicationContext | |
action | Authorization action. |
objectType | Type of business object. |
criteria | The criteria object provided. |
Definition at line 342 of file BusinessRules.cs.
◆ HasPermission() [5/5]
Checks per-type authorization rules.
- Parameters
-
applicationContext | |
action | Authorization action. |
objectType | Type of business object. |
ruleSet | The rule set. |
- Returns
true
if the specified action has permission; otherwise, false
.
Definition at line 360 of file BusinessRules.cs.
◆ OnGetChildren()
Override this method to insert your child object references into the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
formatter | Reference to MobileFormatter instance. Use this to convert child references to/from reference id values. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 1006 of file BusinessRules.cs.
◆ OnGetState()
Override this method to insert your field values into the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 969 of file BusinessRules.cs.
◆ OnSetChildren()
Override this method to retrieve your child object references from the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
formatter | Reference to MobileFormatter instance. Use this to convert child references to/from reference id values. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 1028 of file BusinessRules.cs.
◆ OnSetState()
Override this method to retrieve your field values from the MobileFormatter serialzation stream.
- Parameters
-
info | Object containing the data to serialize. |
mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
Definition at line 987 of file BusinessRules.cs.
◆ CascadeOnDirtyProperties
bool Csla.Rules.BusinessRules.CascadeOnDirtyProperties |
|
getset |
Gets or sets a value indicating whether rule engine should cacade n-leves when property value is changed from OuputPropertyValues.
true
if [cascade when changed]; otherwise, false
.
Definition at line 112 of file BusinessRules.cs.
◆ IsValid
bool Csla.Rules.BusinessRules.IsValid |
|
get |
Gets a value indicating whether there are any currently broken rules, which would mean the object is not valid.
Definition at line 254 of file BusinessRules.cs.
◆ ProcessThroughPriority
int Csla.Rules.BusinessRules.ProcessThroughPriority |
|
getset |
Gets or sets the priority through which all rules will be processed.
Definition at line 80 of file BusinessRules.cs.
◆ RuleSet
string?? Csla.Rules.BusinessRules.RuleSet |
|
getset |
Gets or sets the rule set to use for this business object instance.
Definition at line 91 of file BusinessRules.cs.
◆ RunningAsyncRules
bool Csla.Rules.BusinessRules.RunningAsyncRules |
|
getset |
Gets a value indicating whether any async rules are currently executing.
Definition at line 298 of file BusinessRules.cs.
◆ RunningRules
bool Csla.Rules.BusinessRules.RunningRules |
|
get |
Gets a value indicating whether a CheckRules operation is in progress.
Definition at line 273 of file BusinessRules.cs.
◆ SuppressRuleChecking
bool Csla.Rules.BusinessRules.SuppressRuleChecking |
|
getset |
Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoked.
True to suppress all rule method invocation.
Definition at line 69 of file BusinessRules.cs.