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.
RootUpdateAllChildren.cs
Go to the documentation of this file.
1using System;
2
4{
6 public class RootUpdateAllChildren : BusinessBase<RootUpdateAllChildren>
7 {
8 private static PropertyInfo<string> DataProperty = RegisterProperty<string>(typeof(RootUpdateAllChildren), new PropertyInfo<string>("Data"));
9 public string Data
10 {
11 get { return GetProperty<string>(DataProperty); }
12 set { SetProperty<string>(DataProperty, value); }
13 }
14
15 private static PropertyInfo<Child> ChildProperty = RegisterProperty<Child>(typeof(RootUpdateAllChildren), new PropertyInfo<Child>("Child"));
16 public Child Child
17 {
18 get
19 {
20 return GetProperty<Child>(ChildProperty);
21 }
22 }
23
24 private static PropertyInfo<ChildList> ChildListProperty = RegisterProperty<ChildList>(typeof(RootUpdateAllChildren), new PropertyInfo<ChildList>("ChildList"));
26 {
27 get
28 {
29 return GetProperty<ChildList>(ChildListProperty);
30 }
31 }
32
33 public void FetchChild(IChildDataPortal<Child> childDataPortal)
34 {
35 SetProperty<Child>(ChildProperty, Child.GetChild(childDataPortal));
36 }
37
38 [Create]
39 private void Create([Inject]IChildDataPortal<Child> childDataPortal, [Inject]IChildDataPortal<ChildList> childListDataPortal)
40 {
41 LoadProperty(ChildProperty, Child.NewChild(childDataPortal));
42 LoadProperty(ChildListProperty, ChildList.GetList(childListDataPortal));
43 }
44
45 [Insert]
46 protected void DataPortal_Insert()
47 {
48 FieldManager.UpdateAllChildren();
49 }
50
51 [Update]
52 protected void DataPortal_Update()
53 {
54 FieldManager.UpdateAllChildren();
55 }
56 }
57}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
static Child GetChild(IChildDataPortal< Child > childDataPortal)
static Child NewChild(IChildDataPortal< Child > childDataPortal)
static ChildList GetList(IChildDataPortal< ChildList > childDataPortal)
void FetchChild(IChildDataPortal< Child > childDataPortal)
Interface defining the members of the child data portal type.
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Update
Update operation (includes insert, update and delete self).