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.
AParent.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="AParent.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;
9using System.Collections.Generic;
10using System.Text;
11
12namespace Csla.Test.LazyLoad
13{
15 public class AParent : Csla.BusinessBase<AParent>
16 {
17 public static PropertyInfo<Guid> IdProperty = RegisterProperty<Guid>(c => c.Id);
18 public Guid Id
19 {
20 get { return GetProperty(IdProperty); }
21 set { SetProperty(IdProperty, value); }
22 }
23
24 private static PropertyInfo<AChildList> ChildListProperty =
25 RegisterProperty<AChildList>(c => c.ChildList, "Child list", null, RelationshipTypes.LazyLoad);
27 {
28 get
29 {
30 return LazyGetProperty(ChildListProperty, FetchChildList);
31 }
32 }
33
35 {
36 if (FieldManager.FieldExists(ChildListProperty))
37 return ReadProperty<AChildList>(ChildListProperty);
38 else
39 return null;
40 }
41
42 public new int EditLevel
43 {
44 get { return base.EditLevel; }
45 }
46
47 [Create]
48 private void Create()
49 {
50 using (BypassPropertyChecks)
51 Id = Guid.NewGuid();
52 }
53
54 private AChildList FetchChildList()
55 {
57 return dataPortal.Fetch();
58 }
59 }
60}
Provides consistent context information between the client and server DataPortal objects.
object GetRequiredService(Type serviceType)
Attempts to get service via DI using ServiceProviderServiceExtensions.GetRequiredService.
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
AChildList GetChildList()
Definition: AParent.cs:34
static PropertyInfo< Guid > IdProperty
Definition: AParent.cs:17
Interface defining the members of the data portal type.
Definition: IDataPortalT.cs:17
object Fetch(params object[] criteria)
Called by a factory method in a business class to retrieve an object, which is loaded with values fro...
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.