CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
BusinessRule.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="BusinessRule.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Base class used to create business and validation</summary>
7//-----------------------------------------------------------------------
8namespace Csla.Rules
9{
15 {
16 private bool _isAsync;
17
22 public override bool IsAsync
23 {
24 get { return _isAsync; }
25 protected set
26 {
27 CanWriteProperty("IsAsync");
28 _isAsync = value;
29 }
30 }
31
36 protected BusinessRule()
37 : this(null)
38 { }
39
45 protected BusinessRule(Csla.Core.IPropertyInfo primaryProperty)
46 : base(primaryProperty)
47 { }
48
53 protected virtual void Execute(IRuleContext context)
54 { }
55
57 {
58 PropertiesLocked = true;
59 Execute(context);
60 }
61 }
62}
Base class used to create business and validation rules.
void CanWriteProperty(string argument)
Allows or blocks changing a property value.
bool PropertiesLocked
Gets or sets a value indicating whether property values should be locked because an async operation i...
Base class used to create business and validation rules.
Definition: BusinessRule.cs:15
BusinessRule()
Creates an instance of the rule that applies to a business object as a whole.
Definition: BusinessRule.cs:36
virtual void Execute(IRuleContext context)
Business or validation rule implementation.
Definition: BusinessRule.cs:53
BusinessRule(Csla.Core.IPropertyInfo primaryProperty)
Creates an instance of the rule that applies to a specfic property.
Definition: BusinessRule.cs:45
override bool IsAsync
Gets a value indicating whether the rule will run on a background thread.
Definition: BusinessRule.cs:23
Maintains metadata about a property.
Interface defining a business/validation rule implementation.
void Execute(IRuleContext context)
Business or validation rule implementation.
Context information provided to a business rule when it is invoked.
Definition: IRuleContext.cs:22