8using System.Collections.Generic;
18 [System.Diagnostics.DebuggerNonUserCode]
23 #region Business Methods
32 private static PropertyInfo<string> MethodCalledProperty = RegisterProperty<string>(c => c.MethodCalled);
35 get {
return GetProperty(MethodCalledProperty); }
36 set { SetProperty(MethodCalledProperty, value); }
51 #region DataPortal_Create
58 private void DoCreate(
int id)
65 throw new Exception(
"Bad data");
70 #region DataPortal_Fetch
73 private void DataPortal_Fetch(
int id)
78 private void DataPortal_Fetch(
string id)
80 DoFetch(
int.Parse(
id));
83 private void DataPortal_Fetch(Guid
id)
88 private void DoFetch(
int id)
91 TestResults.Reinitialise();
92 TestResults.Add(
"PrimitiveCriteriaSingle",
"Fetched");
95 throw new Exception(
"Bad data");
100 #region DataPortal_Insert / DataPortal_Update / DataPortal_Delete
105 DoInsertUpdate(
false);
108 private void DoInsertUpdate(
bool isUpdate)
110 var insertOrUpdate = isUpdate ?
"Updated" :
"Inserted";
123 private void DataPortal_Delete(
int id)
This is the base class from which most business objects will be derived.
Maintains metadata about a property.
static readonly PropertyInfo< int > IdProperty
PrimitiveCriteriaSingle()
void DataPortal_Create(int id)
override object GetIdValue()
Override this method to return a unique identifying value for this object.
Static dictionary-like class that offers similar functionality to GlobalContext This is used in tests...
static void Reinitialise()
Reinitialise the dictionary, clearing any existing results, ready for the next test
static void Add(string key, string value)
Add an item to the test results, to indicate an outcome of a particular operation
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Delete
Delete operation.