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/Async/ChildList.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ChildList.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;
10using System.Threading.Tasks;
11
13{
15 public class ChildList : BusinessListBase<ChildList, Child>
16 {
17 public static async Task<ChildList> GetListAsync(IChildDataPortal<ChildList> childDataPortal)
18 {
19 return await childDataPortal.FetchChildAsync();
20 }
21
22 public ChildList()
23 {
24 }
25
26 public object MyParent
27 {
28 get { return this.Parent; }
29 }
30
31 private string _status;
32 public string Status
33 {
34 get { return _status; }
35 }
36
37 [FetchChild]
38 private async Task Child_FetchAsync()
39 {
40 await Task.Delay(5);
41 _status = "Fetched";
42 }
43
44 [UpdateChild]
45 protected override async Task Child_UpdateAsync(params object[] p)
46 {
47 await base.Child_UpdateAsync(p);
48 _status = "Updated";
49 }
50 }
51}
This is the base class from which most business collections or lists will be derived.
Core.IParent Parent
Provide access to the parent reference for use in child object code.
override async Task Child_UpdateAsync(params object[] p)
Asynchronously saves all items in the list, automatically performing insert, update or delete operati...
static async Task< ChildList > GetListAsync(IChildDataPortal< ChildList > childDataPortal)
Interface defining the members of the child data portal type.
Task< object > FetchChildAsync(params object[] criteria)
Starts an asynchronous data portal operation to create a business object.
@ Serializable
Prevents updating or inserting until the transaction is complete.