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.
TestChild.cs
Go to the documentation of this file.
1using System;
2using Csla;
4
6{
8 public class TestChild : BusinessBase<TestChild>
9 {
10 #region Business Methods
11
12 // example with private backing field
13 public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(p => p.Id);
14 private int _Id = IdProperty.DefaultValue;
15 public int Id
16 {
17 get { return GetProperty(IdProperty, _Id); }
18 set { SetProperty(IdProperty, ref _Id, value); }
19 }
20
21 // example with managed backing field
22 public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(p => p.Name);
23 public string Name
24 {
25 get { return GetProperty(NameProperty); }
26 set { SetProperty(NameProperty, value); }
27 }
28
29 #endregion
30
31 #region Factory Methods
32
33 internal static TestChild NewEditableChild()
34 {
36 }
37
38 internal static TestChild GetEditableChild(object childData)
39 {
40 return Csla.DataPortal.FetchChild<TestChild>(childData);
41 }
42
43 #endregion
44
45 #region Data Access
46
47 [RunLocal]
48 protected override void Child_Create()
49 {
50 // omit this override if you have no defaults to set
51 base.Child_Create();
52 }
53
54 [RunLocal]
55 private void Child_Fetch(object childData)
56 {
57 }
58
59 [RunLocal]
60 private void Child_Insert(object parent)
61 {
62 }
63
64 [RunLocal]
65 private void Child_Update(object parent)
66 {
67 }
68
69 [RunLocal]
70 private void Child_DeleteSelf()
71 {
72 }
73
74 #endregion
75 }
76}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Client side data portal used for making asynchronous data portal calls in .NET.
Definition: DataPortalT.cs:24
T CreateChild()
Creates and initializes a new child business object.
Definition: DataPortalT.cs:639
T FetchChild()
Fetches an existing child business object.
Definition: DataPortalT.cs:685
Maintains metadata about a property.
static readonly PropertyInfo< string > NameProperty
Definition: TestChild.cs:22
static readonly PropertyInfo< int > IdProperty
Definition: TestChild.cs:13
@ Serializable
Prevents updating or inserting until the transaction is complete.