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.
HasBadSharedRule.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="HasBadSharedRule.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//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Text;
11using Csla;
13
15{
16#if TESTING
17 [System.Diagnostics.DebuggerStepThrough]
18#endif
20 public class HasBadSharedRule : BusinessBase<HasBadSharedRule>
21 {
22 public static PropertyInfo<string> DataProperty = RegisterProperty<string>(c => c.Data);
23 public string Data
24 {
25 get { return GetProperty(DataProperty); }
26 set { SetProperty(DataProperty, value); }
27 }
28
29 protected override void AddBusinessRules()
30 {
31 BusinessRules.AddRule(new BadRule { PrimaryProperty = DataProperty });
32 }
33
34 public class BadRule : Rules.BusinessRule
35 {
36 protected override void Execute(Rules.IRuleContext context)
37 {
38 context.AddErrorResult("Bad rule");
39 }
40 }
41 }
42}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
override void Execute(Rules.IRuleContext context)
static PropertyInfo< string > DataProperty
@ Serializable
Prevents updating or inserting until the transaction is complete.