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.
EditableGetSetRuleValidation.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="EditableGetSetRuleValidation.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;
9
11{
12#if TESTING
13 [System.Diagnostics.DebuggerNonUserCode]
14#endif
16 public class EditableGetSetRuleValidation : BusinessBase<EditableGetSetRuleValidation>
17 {
18 #region Business Rules
19
20 protected override void AddBusinessRules()
21 {
22 // Id
23 BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(_idProperty));
24
25 // MemberBackedId
26 BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(_memberBackedIdProperty));
27
28 // MemberBackedIdWithNoRelationshipTypes
30 }
31
32 #endregion
33
34 #region Properties
35
36 public static readonly PropertyInfo<System.String> _memberBackedIdProperty = RegisterProperty<System.String>(p => p.MemberBackedId, RelationshipTypes.PrivateField);
37 private System.String _memberBackedId = _memberBackedIdProperty.DefaultValue;
38 public System.String MemberBackedId
39 {
40 get { return GetProperty(_memberBackedIdProperty, _memberBackedId); }
41 set { SetProperty(_memberBackedIdProperty, ref _memberBackedId, value ); }
42 }
43
44 public static readonly PropertyInfo<System.String> _memberBackedIdWithNoRelationshipTypesProperty = RegisterProperty<System.String>(p => p.MemberBackedIdWithNoRelationshipTypes, string.Empty);
45 private System.String _memberBackedIdWithNoRelationshipTypes = _memberBackedIdWithNoRelationshipTypesProperty.DefaultValue;
47 {
48 get { return GetProperty(_memberBackedIdWithNoRelationshipTypesProperty, _memberBackedIdWithNoRelationshipTypes); }
49 set { SetProperty(_memberBackedIdWithNoRelationshipTypesProperty, ref _memberBackedIdWithNoRelationshipTypes, value); }
50 }
51
52 public static readonly PropertyInfo<System.String> _idProperty = RegisterProperty<System.String>(p => p.Id, string.Empty);
53 public System.String Id
54 {
55 get { return GetProperty(_idProperty); }
56 set { SetProperty(_idProperty, value); }
57 }
58
59 #endregion
60
61 #region Data Access
62
63 [RunLocal]
64 [Create]
65 protected void DataPortal_Create()
66 {
67 BusinessRules.CheckRules();
68 }
69
70 #endregion
71
72 #region Factory Methods
73
75 {
76 return dataPortal.Create();
77 }
78
79 #endregion
80 }
81}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
Business rule for a required string.
Definition: CommonRules.cs:106
static readonly PropertyInfo< System.String > _memberBackedIdWithNoRelationshipTypesProperty
static EditableGetSetRuleValidation NewEditableGetSetValidation(IDataPortal< EditableGetSetRuleValidation > dataPortal)
static readonly PropertyInfo< System.String > _idProperty
static readonly PropertyInfo< System.String > _memberBackedIdProperty
Interface defining the members of the data portal type.
Definition: IDataPortalT.cs:17
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...
RelationshipTypes
List of valid relationship types between a parent object and another object through a managed propert...
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Create
Create operation.