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.
Csla.test/FieldManager/Root.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="Root.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
9using System;
10
12{
14 public class Root : BusinessBase<Root>
15 {
16 private static PropertyInfo<string> DataProperty = RegisterProperty<string>(typeof(Root), new PropertyInfo<string>("Data"));
17 public string Data
18 {
19 get { return GetProperty<string>(DataProperty); }
20 set { SetProperty<string>(DataProperty, value); }
21 }
22
23 private static PropertyInfo<Child> ChildProperty = RegisterProperty<Child>(typeof(Root), new PropertyInfo<Child>("Child"));
24 public Child Child
25 {
26 get
27 {
28 return GetProperty<Child>(ChildProperty);
29 }
30 }
31
32 private static PropertyInfo<ChildList> ChildListProperty = RegisterProperty<ChildList>(typeof(Root), new PropertyInfo<ChildList>("ChildList"));
34 {
35 get
36 {
37 return GetProperty<ChildList>(ChildListProperty);
38 }
39 }
40
41 public void FetchChild(IChildDataPortal<Child> childDataPortal)
42 {
43 SetProperty(ChildProperty, Child.GetChild(childDataPortal));
44 }
45
46 [Create]
47 protected void Create([Inject] IChildDataPortal<Child> childDataPortal, [Inject]IChildDataPortal<ChildList> childListDataPortal)
48 {
49 LoadProperty(ChildProperty, Child.NewChild(childDataPortal));
50 LoadProperty(ChildListProperty, ChildList.GetList(childListDataPortal));
51 }
52
53 [Insert]
54 protected void DataPortal_Insert()
55 {
56 FieldManager.UpdateChildren();
57 }
58
59 [Update]
60 protected void DataPortal_Update()
61 {
62 FieldManager.UpdateChildren();
63 }
64 }
65}
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 Create([Inject] IChildDataPortal< Child > childDataPortal, [Inject]IChildDataPortal< ChildList > childListDataPortal)
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).