![]() |
CSLA .NET 10.0.0
A home for your business logic
|
Tracks the business rules for a business object. More...
Classes | |
| class | RunRulesResult |
Public Member Functions | |
| BusinessRules () | |
| Creates an instance of the type. | |
| BusinessRules (ApplicationContext applicationContext, IHostRules target, IUnhandledAsyncRuleExceptionHandler unhandledAsyncRuleExceptionHandler) | |
| Creates an instance of the type. | |
| string[] | GetRuleDescriptions () |
| Gets a list of rule:// URI values for the rules defined in the object. | |
| void | AddRule (IBusinessRuleBase rule) |
| Associates a business rule with the business object. | |
| void | AddRule (IBusinessRuleBase rule, string? ruleSet) |
| Associates a business rule with the business object. | |
| void | AddRule (IAuthorizationRuleBase rule) |
| Associates an authorization rule with the business object. | |
| BrokenRulesCollection | GetBrokenRules () |
| Gets the broken rules list. | |
| bool | GetPropertyBusy (IPropertyInfo property) |
| Gets a value indicating whether a specific property has any async rules running. | |
| bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, IMemberInfo element) |
| Checks per-property authorization rules. | |
| async Task< bool > | HasPermissionAsync (ApplicationContext applicationContext, AuthorizationActions action, IMemberInfo element, CancellationToken ct) |
| Checks per-property authorization rules. | |
| bool | CachePermissionResult (AuthorizationActions action, IMemberInfo element) |
| Gets a value indicating whether the permission result can be cached. | |
| Task< List< string > > | CheckRulesAsync (IPropertyInfo property) |
| Invokes all rules for a specific property of the business type. | |
| async Task< List< string > > | CheckRulesAsync (IPropertyInfo property, TimeSpan timeout) |
| Invokes all rules for a specific property of the business type. | |
| Task< List< string > > | CheckRulesAsync () |
| Invokes all rules for the business type. | |
| Task< List< string > > | CheckRulesAsync (int timeout) |
| Invokes all rules for the business type. | |
| async Task< List< string > > | CheckRulesAsync (TimeSpan timeout) |
| Invokes all rules for the business type. | |
| List< string > | CheckRules () |
| Invokes all rules for the business type. | |
| List< string > | CheckObjectRules () |
| Invokes all rules attached at the class level of the business type. | |
| List< string > | CheckRules (IPropertyInfo property) |
| Invokes all rules for a specific property of the business type. | |
| void | AddDataAnnotations () |
| Adds validation rules corresponding to property data annotation attributes. | |
Static Public Member Functions | |
| static void | AddRule (Type objectType, IAuthorizationRuleBase rule) |
| Associates a per-type authorization rule with the business type in the default rule set. | |
| static void | AddRule (Type objectType, IAuthorizationRuleBase rule, string ruleSet) |
| Associates a per-type authorization rule with the business type. | |
| static void | AddRule (ApplicationContext? applicationContext, Type objectType, IAuthorizationRuleBase rule, string ruleSet) |
| Associates a per-type authorization rule with the business type. | |
| static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType) |
| Checks per-type authorization rules. | |
| static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, object?[]? criteria) |
| Checks per-type authorization rules. | |
| static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, string? ruleSet) |
| Checks per-type authorization rules. | |
| static bool | HasPermission (ApplicationContext applicationContext, AuthorizationActions action, object obj) |
| Checks per-instance authorization rules. | |
| static Task< bool > | HasPermissionAsync (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, CancellationToken ct) |
| Checks per-type authorization rules. | |
| static Task< bool > | HasPermissionAsync (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, object?[]? criteria, CancellationToken ct) |
| Checks per-type authorization rules. | |
| static Task< bool > | HasPermissionAsync (ApplicationContext applicationContext, AuthorizationActions action, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type objectType, string? ruleSet, CancellationToken ct) |
| Checks per-type authorization rules. | |
| static Task< bool > | HasPermissionAsync (ApplicationContext applicationContext, AuthorizationActions action, object obj, CancellationToken ct) |
| Checks per-instance authorization rules. | |
| static BrokenRulesTree | GetAllBrokenRules (object root) |
| Gets all nodes in tree that have IsValid = false (and all parents). | |
| static BrokenRulesTree | GetAllBrokenRules (object root, bool errorsOnly) |
| Gets all nodes in tree that have broken rules. | |
Protected Member Functions | |
| override void | OnGetState (SerializationInfo info, StateMode mode) |
| Override this method to insert your field values into the MobileFormatter serialization stream. | |
| override void | OnSetState (SerializationInfo info, StateMode mode) |
| Override this method to retrieve your field values from the MobileFormatter serialization stream. | |
| override void | OnGetChildren (SerializationInfo info, MobileFormatter formatter) |
| Override this method to insert your child object references into the MobileFormatter serialization stream. | |
| override void | OnSetChildren (SerializationInfo info, MobileFormatter formatter) |
| Override this method to retrieve your child object references from the MobileFormatter serialization stream. | |
| virtual void | Deserialized () |
| Invoked after the object has been deserialized to allow derived classes to perform custom post-deserialization processing. | |
| Protected Member Functions inherited from Csla.Core.MobileObject | |
| virtual void | OnGetMetastate (BinaryWriter writer) |
| Override this method to write field values directly to a binary stream for metastate serialization. | |
| virtual void | OnSetMetastate (BinaryReader reader) |
| Override this method to read field values directly from a binary stream for metastate deserialization. | |
Properties | |
| bool | SuppressRuleChecking [get, set] |
| Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoked. | |
| int | ProcessThroughPriority [get, set] |
| Gets or sets the priority through which all rules will be processed. | |
| string | RuleSet [get, set] |
| Gets or sets the rule set to use for this business object instance. | |
| bool | CascadeOnDirtyProperties [get, set] |
| Gets or sets a value indicating whether rule engine should cascade n-levels when property value is changed from OuputPropertyValues. | |
| bool | IsValid [get] |
| Gets a value indicating whether there are any currently broken rules, which would mean the object is not valid. | |
| bool | RunningRules [get] |
| Gets a value indicating whether a CheckRules operation is in progress. | |
| bool | RunningAsyncRules [get, set] |
| Gets a value indicating whether any async rules are currently executing. | |
Tracks the business rules for a business object.
|
inline |
Creates an instance of the type.
|
inline |
Creates an instance of the type.
| applicationContext | |
| target | Target business object. |
| unhandledAsyncRuleExceptionHandler | Handler for unhandled exceptions that occur during asynchronous rule execution. |
| ArgumentNullException | applicationContext or target is null. |
|
inline |
Adds validation rules corresponding to property data annotation attributes.
|
inlinestatic |
Associates a per-type authorization rule with the business type.
| applicationContext | ApplicationContext instance |
| objectType | Type of business object. |
| rule | Rule object. |
| ruleSet | Rule set name. |
| ArgumentNullException | objectType or rule is null. |
|
inline |
Associates an authorization rule with the business object.
| rule | Rule object. |
| ArgumentNullException | rule is null. |
|
inline |
Associates a business rule with the business object.
| rule | Rule object. |
| ArgumentNullException | rule is null. |
|
inline |
Associates a business rule with the business object.
| rule | Rule object. |
| ruleSet | Rule set name. |
| ArgumentNullException | rule is null. |
|
inlinestatic |
Associates a per-type authorization rule with the business type in the default rule set.
| objectType | Type of business object. |
| rule | Rule object. |
| ArgumentNullException | objectType or rule is null. |
|
inlinestatic |
Associates a per-type authorization rule with the business type.
| objectType | Type of business object. |
| rule | Rule object. |
| ruleSet | Rule set name. |
| ArgumentNullException | objectType or rule is null. |
|
inline |
Gets a value indicating whether the permission result can be cached.
| action | Authorization action. |
| element | Property or method to check. |
| ArgumentNullException | element is null. |
|
inline |
Invokes all rules attached at the class level of the business type.
|
inline |
Invokes all rules for the business type.
|
inline |
Invokes all rules for a specific property of the business type.
| property | Property to check. |
| System.ArgumentNullException | If property is null |
|
inline |
Invokes all rules for the business type.
|
inline |
Invokes all rules for the business type.
| timeout | Timeout value in milliseconds |
|
inline |
Invokes all rules for a specific property of the business type.
| property | Property to check. |
| System.ArgumentNullException | If property is null |
|
inline |
Invokes all rules for a specific property of the business type.
| property | Property to check. |
| timeout | Timeout to wait for the rule completion. |
| System.ArgumentNullException | If property is null |
|
inline |
Invokes all rules for the business type.
| timeout | Timeout value. |
|
inlineprotectedvirtual |
Invoked after the object has been deserialized to allow derived classes to perform custom post-deserialization processing.
Override this method in a derived class to implement actions that should occur immediately after deserialization, such as initializing transient fields or validating object state. This method is called automatically during the deserialization process.
Implements Csla.Serialization.Mobile.ISerializationNotification.
|
inlinestatic |
Gets all nodes in tree that have IsValid = false (and all parents).
| root | The root. |
| ArgumentNullException | root is null. |
|
inlinestatic |
Gets all nodes in tree that have broken rules.
| root | The root. |
| errorsOnly | if set to true will only return objects that gave IsValid = false. |
| ArgumentNullException | root is null. |
|
inline |
Gets the broken rules list.
|
inline |
Gets a value indicating whether a specific property has any async rules running.
| property | Property to check. |
| ArgumentNullException | property is null. |
|
inline |
Gets a list of rule:// URI values for the rules defined in the object.
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | |
| action | Authorization action. |
| objectType | Type of business object. |
| ArgumentNullException | applicationContext or objectType is null. |
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | |
| action | Authorization action. |
| objectType | Type of business object. |
| criteria | The criteria object provided. |
| ArgumentNullException | applicationContext or objectType is null. |
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | |
| action | Authorization action. |
| objectType | Type of business object. |
| ruleSet | The rule set. |
true if the specified action has permission; otherwise, false. | ArgumentNullException | applicationContext or objectType is null. |
|
inline |
Checks per-property authorization rules.
| applicationContext | |
| action | Authorization action. |
| element | Property or method to check. |
| ArgumentNullException | applicationContext or element is null. |
|
inlinestatic |
Checks per-instance authorization rules.
| applicationContext | |
| action | Authorization action. |
| obj | Business object instance. |
| ArgumentNullException | applicationContext or obj is null. |
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | The application context. |
| action | The authorization action. |
| objectType | The type of the business object. |
| ct | The cancellation token. |
| ArgumentNullException | applicationContext or objectType is null. |
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | The application context. |
| action | The authorization action. |
| objectType | The type of the business object. |
| criteria | The criteria object provided. |
| ct | The cancellation token. |
| ArgumentNullException | applicationContext or objectType is null. |
|
inlinestatic |
Checks per-type authorization rules.
| applicationContext | The application context. |
| action | Authorization action. |
| objectType | Type of business object. |
| ruleSet | The rule set. |
| ct | The cancellation token. |
true if the specified action has permission; otherwise, false. | ArgumentNullException | applicationContext or objectType is null. |
|
inline |
Checks per-property authorization rules.
| applicationContext | The application context. |
| action | The authorization action. |
| element | The property or method to check. |
| ct | The cancellation token. |
| ArgumentNullException | applicationContext or element is null. |
|
inlinestatic |
Checks per-instance authorization rules.
| applicationContext | The application context. |
| action | The authorization action. |
| obj | The business object instance. |
| ct | The cancellation token. |
| ArgumentNullException | applicationContext or obj is null. |
|
inlineprotectedvirtual |
Override this method to insert your child object references into the MobileFormatter serialization stream.
| 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.
|
inlineprotectedvirtual |
Override this method to insert your field values into the MobileFormatter serialization stream.
| info | Object containing the data to serialize. |
| mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
|
inlineprotectedvirtual |
Override this method to retrieve your child object references from the MobileFormatter serialization stream.
| 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.
|
inlineprotectedvirtual |
Override this method to retrieve your field values from the MobileFormatter serialization stream.
| info | Object containing the data to serialize. |
| mode | The StateMode indicating why this method was invoked. |
Reimplemented from Csla.Core.MobileObject.
|
getset |
Gets or sets a value indicating whether rule engine should cascade n-levels when property value is changed from OuputPropertyValues.
true if [cascade when changed]; otherwise, false.
|
get |
Gets a value indicating whether there are any currently broken rules, which would mean the object is not valid.
|
getset |
Gets or sets the priority through which all rules will be processed.
|
getset |
Gets or sets the rule set to use for this business object instance.
|
getset |
Gets a value indicating whether any async rules are currently executing.
|
get |
Gets a value indicating whether a CheckRules operation is in progress.
|
getset |
Gets or sets a value indicating whether calling CheckRules should result in rule methods being invoked.
True to suppress all rule method invocation.