CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
BusinessRuleAsync.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="BusinessRuleAsync.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//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Linq;
11using System.Text;
12using System.Threading.Tasks;
13using Csla.Properties;
14
15namespace Csla.Rules
16{
22 {
27 public override bool IsAsync
28 {
29 get { return true; }
30 protected set { }
31 }
32
38 : this(null)
39 { }
40
46 protected BusinessRuleAsync(Csla.Core.IPropertyInfo primaryProperty)
47 : base(primaryProperty)
48 { }
49
54 protected virtual Task ExecuteAsync(IRuleContext context)
55 {
56 return Task.CompletedTask;
57 }
58
60 {
61 PropertiesLocked = true;
62 return ExecuteAsync(context);
63 }
64 }
65}
Base class used to create async business and validation rules.
BusinessRuleAsync()
Creates an instance of the rule that applies to a business object as a whole.
BusinessRuleAsync(Csla.Core.IPropertyInfo primaryProperty)
Creates an instance of the rule that applies to a specfic property.
override bool IsAsync
Gets a value indicating whether the rule will run on a background thread.
virtual Task ExecuteAsync(IRuleContext context)
Business or validation rule implementation.
Base class used to create business and validation rules.
bool PropertiesLocked
Gets or sets a value indicating whether property values should be locked because an async operation i...
Maintains metadata about a property.
Interface defining a business/validation rule implementation.
Task ExecuteAsync(IRuleContext context)
Business or validation rule implementation.
Context information provided to a business rule when it is invoked.
Definition: IRuleContext.cs:20