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.
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Events
Macros
Pages
BrokenRulesMergeRoot.cs
Go to the documentation of this file.
1
//-----------------------------------------------------------------------
2
// <copyright file="BrokenRulesMergeRoot.cs" company="Marimer LLC">
3
// Copyright (c) Marimer LLC. All rights reserved.
4
// Website: https://cslanet.com
5
// </copyright>
6
// <summary>no summary</summary>
7
//-----------------------------------------------------------------------
8
using
System;
9
using
System.Collections.Generic;
10
using
System.Text;
11
using
Csla
.
Rules
;
12
using
Csla
.
Serialization
;
13
14
namespace
Csla.Test.ValidationRules
15
{
16
[
Serializable
]
17
public
class
BrokenRulesMergeRoot
:
BusinessBase
<BrokenRulesMergeRoot>
18
{
19
public
static
PropertyInfo<string>
Test1Property
= RegisterProperty<string>(c => c.Test1);
20
public
string
Test1
21
{
22
get
{
return
GetProperty(
Test1Property
); }
23
set
{ SetProperty(
Test1Property
, value); }
24
}
25
26
public
static
PropertyInfo<string>
Test2Property
= RegisterProperty<string>(c => c.Test2);
27
public
string
Test2
28
{
29
get
{
return
GetProperty(
Test2Property
); }
30
set
{ SetProperty(
Test2Property
, value); }
31
}
32
33
protected
override
void
AddBusinessRules
()
34
{
35
BusinessRules
.
AddRule
(
new
RuleBroken
(
Test1Property
));
36
BusinessRules
.
AddRule
(
new
RuleBroken
(
Test2Property
));
37
}
38
39
public
void
Validate
()
40
{
41
BusinessRules
.
CheckRules
();
42
}
43
44
public
class
RuleBroken
:
BusinessRule
45
{
46
public
RuleBroken
(
Csla
.
Core
.
IPropertyInfo
primaryProperty)
47
: base(primaryProperty)
48
{ }
49
50
protected
override
void
Execute
(
IRuleContext
context)
51
{
52
context.
AddErrorResult
(
"Broken: "
+
PrimaryProperty
.FriendlyName);
53
}
54
}
55
56
public
override
BrokenRulesCollection
BrokenRulesCollection
57
{
58
get
59
{
60
var result =
new
BrokenRulesCollection
();
61
result.AddRange(base.BrokenRulesCollection);
62
return
result;
63
}
64
}
65
66
[Create]
67
private
void
Create()
68
{
69
BusinessRules
.
CheckRules
();
70
}
71
}
72
}
Csla.BusinessBase
This is the base class from which most business objects will be derived.
Definition:
BusinessBase.cs:38
Csla.PropertyInfo
Maintains metadata about a property.
Definition:
Csla/PropertyInfo.cs:22
Csla.Rules.BrokenRulesCollection
A collection of currently broken rules.
Definition:
BrokenRulesCollection.cs:27
Csla.Rules.BusinessRuleBase.PrimaryProperty
virtual Csla.Core.IPropertyInfo PrimaryProperty
Gets or sets the primary property affected by this rule.
Definition:
BusinessRuleBase.cs:37
Csla.Rules.BusinessRule
Base class used to create business and validation rules.
Definition:
BusinessRule.cs:15
Csla.Rules.BusinessRules
Tracks the business rules for a business object.
Definition:
BusinessRules.cs:26
Csla.Rules.BusinessRules.CheckRules
List< string > CheckRules()
Invokes all rules for the business type.
Definition:
BusinessRules.cs:492
Csla.Rules.BusinessRules.AddRule
void AddRule(IBusinessRuleBase rule)
Associates a business rule with the business object.
Definition:
BusinessRules.cs:174
Csla.Test.ValidationRules.BrokenRulesMergeRoot.RuleBroken
Definition:
BrokenRulesMergeRoot.cs:45
Csla.Test.ValidationRules.BrokenRulesMergeRoot.RuleBroken.RuleBroken
RuleBroken(Csla.Core.IPropertyInfo primaryProperty)
Definition:
BrokenRulesMergeRoot.cs:46
Csla.Test.ValidationRules.BrokenRulesMergeRoot.RuleBroken.Execute
override void Execute(IRuleContext context)
Business or validation rule implementation.
Definition:
BrokenRulesMergeRoot.cs:50
Csla.Test.ValidationRules.BrokenRulesMergeRoot
Definition:
BrokenRulesMergeRoot.cs:18
Csla.Test.ValidationRules.BrokenRulesMergeRoot.Test1
string Test1
Definition:
BrokenRulesMergeRoot.cs:21
Csla.Test.ValidationRules.BrokenRulesMergeRoot.Validate
void Validate()
Definition:
BrokenRulesMergeRoot.cs:39
Csla.Test.ValidationRules.BrokenRulesMergeRoot.Test2
string Test2
Definition:
BrokenRulesMergeRoot.cs:28
Csla.Test.ValidationRules.BrokenRulesMergeRoot.Test2Property
static PropertyInfo< string > Test2Property
Definition:
BrokenRulesMergeRoot.cs:26
Csla.Test.ValidationRules.BrokenRulesMergeRoot.AddBusinessRules
override void AddBusinessRules()
Definition:
BrokenRulesMergeRoot.cs:33
Csla.Test.ValidationRules.BrokenRulesMergeRoot.BrokenRulesCollection
override BrokenRulesCollection BrokenRulesCollection
Definition:
BrokenRulesMergeRoot.cs:57
Csla.Test.ValidationRules.BrokenRulesMergeRoot.Test1Property
static PropertyInfo< string > Test1Property
Definition:
BrokenRulesMergeRoot.cs:19
Csla.Core.IPropertyInfo
Maintains metadata about a property.
Definition:
Csla/Core/IPropertyInfo.cs:16
Csla.Rules.IRuleContext
Context information provided to a business rule when it is invoked.
Definition:
IRuleContext.cs:22
Csla.Rules.IRuleContext.AddErrorResult
void AddErrorResult(string description)
Add a Error severity result to the Results list.
Csla.Core
Definition:
AddedNewEventArgs.cs:11
Csla.Rules
Definition:
AddObjectAuthorizationRulesContext.cs:11
Csla.Serialization
Definition:
AutoNonSerializedAttribute.cs:11
Csla.Test.ValidationRules
Definition:
Fakes/Server/Validation/RootThrowsException.cs:9
Csla
Definition:
BusinessRuleCases.cs:5
Csla.TransactionIsolationLevel.Serializable
@ Serializable
Prevents updating or inserting until the transaction is complete.
Generated by
1.9.2