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.
BadGetSet.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="BadGetSet.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;
12using Csla;
14
16{
17#if TESTING
18 [System.Diagnostics.DebuggerNonUserCode]
19#endif
21 public class BadGetSet : BusinessBase<BadGetSet>
22 {
23 // the registering class is intentionally incorrect for this test
24 private static PropertyInfo<int> IdProperty = RegisterProperty<int>(typeof(EditableGetSet), new PropertyInfo<int>("Id"));
25 public int Id
26 {
27 get { return GetProperty<int>(IdProperty); }
28 set { SetProperty<int>(IdProperty, value); }
29 }
30
31 public static BadGetSet GetObject(IDataPortal<BadGetSet> dataPortal)
32 {
33 return dataPortal.Fetch();
34 }
35
36 [Fetch]
37 private void Fetch()
38 {
39 }
40 }
41
42#if TESTING
43 [System.Diagnostics.DebuggerNonUserCode]
44#endif
46 public class BadGetSetTwo : BusinessBase<BadGetSetTwo>
47 {
48 public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
49 public int Id
50 {
51 get { return GetProperty<int>(IdProperty); }
52 set { SetProperty<int>(IdProperty, value); }
53 }
54
55 // the registering class is intentionally incorrect for this test
56 public static readonly PropertyInfo<int> IdTwoProperty = RegisterProperty<int>(c => c.Id);
57 public int IdTwo
58 {
59 get { return GetProperty<int>(IdTwoProperty); }
60 set { SetProperty<int>(IdTwoProperty, value); }
61 }
62
64 {
65 return dataPortal.Fetch();
66 }
67
68 [Fetch]
69 private void Fetch()
70 {
71 }
72 }
73}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
static BadGetSet GetObject(IDataPortal< BadGetSet > dataPortal)
Definition: BadGetSet.cs:31
static readonly PropertyInfo< int > IdTwoProperty
Definition: BadGetSet.cs:56
static BadGetSetTwo GetObject(IDataPortal< BadGetSetTwo > dataPortal)
Definition: BadGetSet.cs:63
static readonly PropertyInfo< int > IdProperty
Definition: BadGetSet.cs:48
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...
@ Serializable
Prevents updating or inserting until the transaction is complete.