2using System.Collections.Generic;
3using System.ComponentModel;
5using System.Threading.Tasks;
42 return dataPortal.
Create();
66 : base(primaryProperty)
68 _nameProperty = nameProperty;
69 AffectedProperties.Add(nameProperty);
70 InputProperties =
new List<IPropertyInfo>() { primaryProperty };
79 var bw =
new System.ComponentModel.BackgroundWorker();
81 bw.RunWorkerCompleted += (o, e) =>
83 context.
AddOutValue(_nameProperty,
string.Format(
"customer name {0}", cn));
87 bw.DoWork += (o, e) =>
99 : base(primaryProperty)
102 protected override async Task ExecuteAsync(
IRuleContext context)
110 private void Create()
This is the base class from which most business objects will be derived.
Maintains metadata about a property.
Base class used to create async business and validation rules.
Base class used to create business and validation rules.
Tracks the business rules for a business object.
List< string > CheckRules()
Invokes all rules for the business type.
void AddRule(IBusinessRuleBase rule)
Associates a business rule with the business object.
Business rule for a required string.
static readonly PropertyInfo< string > AsyncAwaitProperty
static readonly PropertyInfo< string > CustomerNameProperty
override void AddBusinessRules()
static readonly PropertyInfo< string > CustomerNumberProperty
static AsyncRuleRoot NewRoot(IDataPortal< AsyncRuleRoot > dataPortal)
Maintains metadata about a property.
Interface defining the members of the data portal type.
object Create(params object[] criteria)
Called by a factory method in a business class to create a new object, which is loaded with default v...
Context information provided to a business rule when it is invoked.
void AddOutValue(object value)
Add an outbound value to update the rule's primary property on the business object once the rule is c...
void Complete()
Indicates that the rule processing is complete, so CSLA .NET will process the Results list.
Dictionary< Csla.Core.IPropertyInfo, object > InputPropertyValues
Gets a dictionary containing copies of property values from the target business object.
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Execute
Execute operation.