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.
AbstractGetSet.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="AbstractGetSet.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.Linq;
11using System.Text;
12
14{
16 public class AbstractGetSet<T> : BusinessBase<T> where T : AbstractGetSet<T>
17 {
18 protected static PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id, "Id");
19 public int Id
20 {
21 get { return GetProperty<int>(IdProperty); }
22 set { SetProperty<int>(IdProperty, value); }
23 }
24
25#pragma warning disable CS0414
26 private static int _forceLoad;
27#pragma warning restore CS0414
28
29 protected AbstractGetSet()
30 {
31 _forceLoad = 0;
32 }
33
34 protected override void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
35 {
36 _forceLoad = 0;
37 base.OnDeserialized(context);
38 }
39 }
40}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
override void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
This method is called on a newly deserialized object after deserialization is complete.
@ Serializable
Prevents updating or inserting until the transaction is complete.