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/DataPortal/ChildEntity.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ChildEntity.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
13{
14 [Serializable()]
15 public class ChildEntity : BusinessBase<ChildEntity>
16 {
17 public static PropertyInfo<int> IDProperty = RegisterProperty<int>(c => c.ID);
18 public static PropertyInfo<string> FirstNameProperty = RegisterProperty<string>(c => c.FirstName);
19 public static PropertyInfo<string> LastNameProperty = RegisterProperty<string>(c => c.LastName);
20
21 public int ID
22 {
23 get { return GetProperty(IDProperty); }
24 }
25
26 public string FirstName
27 {
28 get { return GetProperty(FirstNameProperty); }
29 set { SetProperty(FirstNameProperty, value); }
30 }
31
32 public string LastName
33 {
34 get { return GetProperty(LastNameProperty); }
35 set { SetProperty(LastNameProperty, value); }
36 }
37
38 #region "Object ID value"
39
40 protected override object GetIdValue()
41 {
42 return ReadProperty(IDProperty);
43 }
44
45 #endregion
46
47 [CreateChild]
48 private void Create(int id, string firstName, string lastName)
49 {
50 LoadProperty(IDProperty, id);
51 LoadProperty(FirstNameProperty, firstName);
52 LoadProperty(LastNameProperty, lastName);
53 }
54 }
55}
Maintains metadata about a property.
override object GetIdValue()
Override this method to return a unique identifying value for this object.
@ Serializable
Prevents updating or inserting until the transaction is complete.