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.
MultipleDataAccessBase.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
8{
10 public class MultipleDataAccessBase<T>
11 : BusinessBase<T>
12 where T : MultipleDataAccessBase<T>
13 {
14 public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
15 public int Id
16 {
17 get { return GetProperty(IdProperty); }
18 set { SetProperty(IdProperty, value); }
19 }
20
21 [Fetch]
22 protected void Fetch()
23 {
24 using (BypassPropertyChecks)
25 {
26 Id = int.MaxValue;
27 }
28 }
29
30 [Fetch]
31 protected void Fetch(int id)
32 {
33 using (BypassPropertyChecks)
34 {
35 Id = id;
36 }
37 }
38 }
39}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
object GetProperty(IPropertyInfo propertyInfo)
Gets a property's value as a specified type.
void SetProperty(IPropertyInfo propertyInfo, object newValue)
Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the val...
Maintains metadata about a property.
static readonly PropertyInfo< int > IdProperty
@ Serializable
Prevents updating or inserting until the transaction is complete.