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.
IRuleContext.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="IRuleContext.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Context information provided to a business rule</summary>
7//-----------------------------------------------------------------------
8using Csla.Core;
9using System;
10using System.Collections.Generic;
11using System.Security.Claims;
12using System.Security.Principal;
13using System.Text;
14
15namespace Csla.Rules
16{
21 public interface IRuleContext
22 {
27
31 object Target { get; }
32
37 Dictionary<Csla.Core.IPropertyInfo, object> InputPropertyValues { get; }
44 List<IPropertyInfo> DirtyProperties { get; }
49 Dictionary<Csla.Core.IPropertyInfo, object> OutputPropertyValues { get; }
54 List<RuleResult> Results { get; }
59 string OriginPropertyName { get; }
72 bool IsCascadeContext { get; }
86 bool IsCheckRulesContext { get; }
111 void AddErrorResult(string description);
119 void AddErrorResult(string description, bool stopProcessing);
128 void AddErrorResult(Csla.Core.IPropertyInfo property, string description);
134 void AddWarningResult(string description);
142 void AddWarningResult(string description, bool stopProcessing);
150 void AddWarningResult(Csla.Core.IPropertyInfo property, string description);
156 void AddInformationResult(string description);
162 void AddInformationResult(string description, bool stopProcessing);
170 void AddInformationResult(Csla.Core.IPropertyInfo property, string description);
175 void AddSuccessResult(bool stopProcessing);
181 void AddOutValue(object value);
189 void AddOutValue(Csla.Core.IPropertyInfo property, object value);
201 void Complete();
223 bool TryGetInputValue<T>(PropertyInfo<T> propertyInfo, ref T value);
231 bool TryGetInputValue<T>(IPropertyInfo propertyInfo, ref T value);
245 }
246}
Provides consistent context information between the client and server DataPortal objects.
Maintains metadata about a property.
Maintains metadata about a property.
Defines a data portal service used to get an access to a client-side data portal instance.
Interface defining a business/validation rule implementation.
Context information provided to a business rule when it is invoked.
Definition: IRuleContext.cs:22
bool IsPropertyChangedContext
Gets a value indicating whether this instance is property changed context.
Definition: IRuleContext.cs:79
object Target
Gets a reference to the target business object.
Definition: IRuleContext.cs:31
void AddInformationResult(string description, bool stopProcessing)
Add an Information severity result to the Results list.
void AddOutValue(Csla.Core.IPropertyInfo property, object value)
Add an outbound value to update a property on the business object once the rule is complete.
RuleContextModes ExecuteContext
Gets the execution context.
void AddWarningResult(string description)
Add a Warning severity result to the Results list.
void AddWarningResult(string description, bool stopProcessing)
Add a Warning severity result to the Results list.
bool IsCheckRulesContext
Gets a value indicating whether this instance is check rules context.
Definition: IRuleContext.cs:86
void AddErrorResult(string description, bool stopProcessing)
Add a Error severity result to the Results list.
bool TryGetInputValue< T >(PropertyInfo< T > propertyInfo, ref T value)
Tries to get the value.
List< IPropertyInfo > DirtyProperties
Gets a list of dirty properties (value was updated).
Definition: IRuleContext.cs:44
IDataPortalFactory DataPortalFactory
Gets a data portal factory instance
List< RuleResult > Results
Gets a list of RuleResult objects containing the results of the rule.
Definition: IRuleContext.cs:54
void AddErrorResult(string description)
Add a Error severity result to the Results list.
IBusinessRuleBase Rule
Gets the rule object.
Definition: IRuleContext.cs:26
bool IsCheckObjectRulesContext
Gets a value indicating whether this instance is check object rules context.
Definition: IRuleContext.cs:93
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 AddWarningResult(Csla.Core.IPropertyInfo property, string description)
Add a Warning severity result to the Results list.
void Complete()
Indicates that the rule processing is complete, so CSLA .NET will process the Results list.
void AddSuccessResult(bool stopProcessing)
Add a Success severity result to the Results list.
void AddInformationResult(Csla.Core.IPropertyInfo property, string description)
Add an Information severity result to the Results list.
Dictionary< Csla.Core.IPropertyInfo, object > OutputPropertyValues
Gets a dictionary containing copies of property values that should be updated in the target object.
Definition: IRuleContext.cs:49
Dictionary< Csla.Core.IPropertyInfo, object > InputPropertyValues
Gets a dictionary containing copies of property values from the target business object.
Definition: IRuleContext.cs:37
void AddInformationResult(string description)
Add an Information severity result to the Results list.
void AddDirtyProperty(Csla.Core.IPropertyInfo property)
Adds a property name as a dirty field (changed value).
void ExecuteRule(IBusinessRuleBase innerRule)
Executes the inner rule from the outer rules context.
void AddErrorResult(Csla.Core.IPropertyInfo property, string description)
Add a Error severity result to the Results list.
string OriginPropertyName
Gets or sets the name of the origin property.
Definition: IRuleContext.cs:59
bool IsCascadeContext
Gets a value indicating whether this instance is cascade context as a result of AffectedProperties.
Definition: IRuleContext.cs:72
T GetInputValue< T >(PropertyInfo< T > propertyInfo)
Gets the value.
IRuleContext GetChainedContext(IBusinessRuleBase rule)
Gets a new RuleContext object for a chained rule.
RuleContextModes
RuleContext mode flags
Definition: RuleContext.cs:23