CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.DataPortal< T > Class Template Reference

This is the client-side DataPortal. More...

Inheritance diagram for Csla.DataPortal< T >:
Csla.IDataPortal< T >

Public Member Functions

Create (params object[] criteria)
 Called by a factory method in a business class to create a new object, which is loaded with default values from the database. More...
 
async Task< T > CreateAsync (params object[] criteria)
 Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database. More...
 
void BeginCreate ()
 Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database. More...
 
void BeginCreate (object criteria)
 Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database. More...
 
async void BeginCreate (object criteria, object userState)
 Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database. More...
 
Fetch (params object[] criteria)
 Called by a factory method in a business class to Fetch a new object, which is loaded with default values from the database. More...
 
async Task< T > FetchAsync (params object[] criteria)
 Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database. More...
 
void BeginFetch ()
 Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database. More...
 
void BeginFetch (object criteria)
 Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database. More...
 
async void BeginFetch (object criteria, object userState)
 Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database. More...
 
Update (T obj)
 Called by a factory method in a business class or by the UI to update an object. More...
 
void BeginUpdate (T obj)
 Called by a factory method in a business class or by the UI to update an object. More...
 
async void BeginUpdate (T obj, object userState)
 Called by a factory method in a business class or by the UI to update an object. More...
 
async Task< T > UpdateAsync (T obj)
 Called by a factory method in a business class or by the UI to update an object. More...
 
void Delete (params object[] criteria)
 Called by a factory method in a business class or by the UI to delete an object. More...
 
void BeginDelete (object criteria)
 Called by a factory method in a business class or by the UI to delete an object. More...
 
async void BeginDelete (object criteria, object userState)
 Called by a factory method in a business class or by the UI to delete an object. More...
 
async Task DeleteAsync (params object[] criteria)
 Called by a factory method in a business class or by the UI to delete an object. More...
 
Execute (T command)
 Called by a factory method in a business class or by the UI to execute a command object. More...
 
void BeginExecute (T command)
 Called by a factory method in a business class or by the UI to execute a command object. More...
 
async void BeginExecute (T command, object userState)
 Called by a factory method in a business class or by the UI to execute a command object. More...
 
async Task< T > ExecuteAsync (T command)
 Called by a factory method in a business class or by the UI to execute a command object. More...
 

Static Public Member Functions

static T Create< T > (params object[] criteria)
 Called by a factory method in a business class to create a new object, which is loaded with default values from the database. More...
 
static T Create< T > ()
 Called by a factory method in a business class to create a new object, which is loaded with default values from the database. More...
 
static object Create (Type objectType, object criteria)
 Called by a factory method in a business class to create a new object, which is loaded with default values from the database. More...
 
static void BeginCreate< T > (EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to create a business object. More...
 
static void BeginCreate< T > (EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to create a business object. More...
 
static void BeginCreate< T > (object criteria, EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to create a business object. More...
 
static void BeginCreate< T > (object criteria, EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to create a business object. More...
 
static async Task< T > CreateAsync< T > ()
 Starts an asynchronous data portal operation to create a business object. More...
 
static async Task< T > CreateAsync< T > (params object[] criteria)
 Starts an asynchronous data portal operation to create a business object. More...
 
static T Fetch< T > (params object[] criteria)
 Called by a factory method in a business class to retrieve an object, which is loaded with values from the database. More...
 
static T Fetch< T > ()
 Called by a factory method in a business class to retrieve an object, which is loaded with values from the database. More...
 
static void BeginFetch< T > (EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static void BeginFetch< T > (EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static void BeginFetch< T > (object criteria, EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static void BeginFetch< T > (object criteria, EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static async Task< T > FetchAsync< T > ()
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static async Task< T > FetchAsync< T > (params object[] criteria)
 Starts an asynchronous data portal operation to fetch a business object. More...
 
static T Update< T > (T obj)
 Called by the business object's Save() method to insert, update or delete an object in the database. More...
 
static void BeginUpdate< T > (T obj, EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to update a business object. More...
 
static void BeginUpdate< T > (T obj, EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to update a business object. More...
 
static async Task< T > UpdateAsync< T > (T obj)
 Starts an asynchronous data portal operation to update a business object. More...
 
static void Delete< T > (params object[] criteria)
 Called by a Shared (static in C#) method in the business class to cause immediate deletion of a specific object from the database. More...
 
static void BeginDelete< T > (object criteria, EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to delete a business object. More...
 
static void BeginDelete< T > (object criteria, EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to delete a business object. More...
 
static async Task DeleteAsync< T > (params object[] criteria)
 Starts an asynchronous data portal operation to delete a business object. More...
 
static T Execute< T > (T obj)
 Called to execute a Command object on the server. More...
 
static void BeginExecute< T > (T obj, EventHandler< DataPortalResult< T > > callback)
 Starts an asynchronous data portal operation to execute a command object. More...
 
static void BeginExecute< T > (T obj, EventHandler< DataPortalResult< T > > callback, object userState)
 Starts an asynchronous data portal operation to execute a command object. More...
 
static async Task< T > ExecuteAsync< T > (T command)
 Starts an asynchronous data portal operation to execute a command object. More...
 
static T CreateChild< T > ()
 Creates and initializes a new child business object. More...
 
static T CreateChild< T > (params object[] parameters)
 Creates and initializes a new child business object. More...
 
static async Task< T > CreateChildAsync< T > ()
 Creates and initializes a new child business object. More...
 
static async Task< T > CreateChildAsync< T > (params object[] parameters)
 Creates and initializes a new child business object. More...
 
static T FetchChild< T > ()
 Creates and loads an existing child business object. More...
 
static T FetchChild< T > (params object[] parameters)
 Creates and loads an existing child business object. More...
 
static async Task< T > FetchChildAsync< T > ()
 Fetchs and initializes a new child business object. More...
 
static async Task< T > FetchChildAsync< T > (params object[] parameters)
 Fetchs and initializes a new child business object. More...
 
static void UpdateChild (object child)
 Inserts, updates or deletes an existing child business object. More...
 
static void UpdateChild (object child, params object[] parameters)
 Inserts, updates or deletes an existing child business object. More...
 
static async Task UpdateChildAsync (object child)
 Inserts, updates or deletes an existing child business object. More...
 
static async Task UpdateChildAsync (object child, params object[] parameters)
 Inserts, updates or deletes an existing child business object. More...
 
static void ResetProxyFactory ()
 Resets the data portal proxy type, so the next data portal call will reload the proxy type based on current configuration values. More...
 
static void ResetProxyType ()
 Resets the data portal proxy type, so the next data portal call will reload the proxy type based on current configuration values. More...
 
static void ReleaseProxy ()
 Releases any remote data portal proxy object, so the next data portal call will create a new proxy instance. More...
 

Protected Member Functions

virtual void OnCreateCompleted (DataPortalResult< T > e)
 Raises the event. More...
 
virtual void OnFetchCompleted (DataPortalResult< T > e)
 Raises the event. More...
 
virtual void OnUpdateCompleted (DataPortalResult< T > e)
 Raises the event. More...
 
virtual void OnDeleteCompleted (DataPortalResult< T > e)
 Raises the event. More...
 
virtual void OnExecuteCompleted (DataPortalResult< T > e)
 Raises the ExecuteCompleted event. More...
 

Properties

static DataPortalClient.IDataPortalProxyFactory ProxyFactory [getset]
 Gets or sets a reference to a ProxyFactory object that is used to create an instance of the data portal proxy object. More...
 
static string ProxyTypeName [getset]
 Gets or sets the assembly qualified type name of the proxy object to be loaded by the data portal. More...
 
Csla.Core.ContextDictionary GlobalContext [getset]
 Gets a reference to the global context returned from the background thread and/or server. More...
 
- Properties inherited from Csla.IDataPortal< T >
Csla.Core.ContextDictionary GlobalContext [get]
 Gets a reference to the global context returned from the background thread and/or server. More...
 

Events

static Action< System.Object > DataPortalInitInvoke
 Raised by DataPortal before it starts setting up to call a server-side DataPortal method. More...
 
static Action< DataPortalEventArgsDataPortalInvoke
 Raised by DataPortal prior to calling the requested server-side DataPortal method. More...
 
static Action< DataPortalEventArgsDataPortalInvokeComplete
 Raised by DataPortal after the requested server-side DataPortal method call is complete. More...
 
EventHandler< DataPortalResult< T > > CreateCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > FetchCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > UpdateCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > DeleteCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > ExecuteCompleted
 Event indicating an execute operation is complete. More...
 
- Events inherited from Csla.IDataPortal< T >
EventHandler< DataPortalResult< T > > CreateCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > FetchCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > UpdateCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > DeleteCompleted
 Event raised when the operation has completed. More...
 
EventHandler< DataPortalResult< T > > ExecuteCompleted
 Event indicating an execute operation is complete. More...
 

Detailed Description

This is the client-side DataPortal.

Client side data portal used for making asynchronous data portal calls in .NET.

Template Parameters
TType of business object.

Definition at line 23 of file DataPortalT.cs.

Member Function Documentation

◆ BeginCreate() [1/3]

void Csla.DataPortal< T >.BeginCreate ( )

Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database.

Implements Csla.IDataPortal< T >.

Definition at line 227 of file DataPortalT.cs.

◆ BeginCreate() [2/3]

void Csla.DataPortal< T >.BeginCreate ( object  criteria)

Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 239 of file DataPortalT.cs.

◆ BeginCreate() [3/3]

async void Csla.DataPortal< T >.BeginCreate ( object  criteria,
object  userState 
)

Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.
userStateUser state data.

Implements Csla.IDataPortal< T >.

Definition at line 252 of file DataPortalT.cs.

◆ BeginCreate< T >() [1/4]

static void Csla.DataPortal< T >.BeginCreate< T > ( EventHandler< DataPortalResult< T > >  callback)
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.
Parameters
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 109 of file DataPortal.cs.

◆ BeginCreate< T >() [2/4]

static void Csla.DataPortal< T >.BeginCreate< T > ( EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.
Parameters
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 129 of file DataPortal.cs.

◆ BeginCreate< T >() [3/4]

static void Csla.DataPortal< T >.BeginCreate< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback 
)
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.
Parameters
criteriaCriteria describing the object to create.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 151 of file DataPortal.cs.

◆ BeginCreate< T >() [4/4]

static void Csla.DataPortal< T >.BeginCreate< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.
Parameters
criteriaCriteria describing the object to create.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 174 of file DataPortal.cs.

◆ BeginDelete() [1/2]

void Csla.DataPortal< T >.BeginDelete ( object  criteria)

Called by a factory method in a business class or by the UI to delete an object.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 921 of file DataPortalT.cs.

◆ BeginDelete() [2/2]

async void Csla.DataPortal< T >.BeginDelete ( object  criteria,
object  userState 
)

Called by a factory method in a business class or by the UI to delete an object.

Parameters
criteriaObject-specific criteria.
userStateUser state data.

Implements Csla.IDataPortal< T >.

Definition at line 933 of file DataPortalT.cs.

◆ BeginDelete< T >() [1/2]

static void Csla.DataPortal< T >.BeginDelete< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback 
)
static

Starts an asynchronous data portal operation to delete a business object.

Template Parameters
TType of business object to delete.
Parameters
criteriaCriteria describing the object to delete.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 472 of file DataPortal.cs.

◆ BeginDelete< T >() [2/2]

static void Csla.DataPortal< T >.BeginDelete< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to delete a business object.

Template Parameters
TType of business object to delete.
Parameters
criteriaCriteria describing the object to delete.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 495 of file DataPortal.cs.

◆ BeginExecute() [1/2]

void Csla.DataPortal< T >.BeginExecute ( command)

Called by a factory method in a business class or by the UI to execute a command object.

Parameters
commandCommand object to execute.

Implements Csla.IDataPortal< T >.

Definition at line 995 of file DataPortalT.cs.

◆ BeginExecute() [2/2]

async void Csla.DataPortal< T >.BeginExecute ( command,
object  userState 
)

Called by a factory method in a business class or by the UI to execute a command object.

Parameters
commandCommand object to execute.
userStateUser state data.

Implements Csla.IDataPortal< T >.

Definition at line 1007 of file DataPortalT.cs.

◆ BeginExecute< T >() [1/2]

static void Csla.DataPortal< T >.BeginExecute< T > ( obj,
EventHandler< DataPortalResult< T > >  callback 
)
static

Starts an asynchronous data portal operation to execute a command object.

Template Parameters
TType of object to execute.
Parameters
objReference to the object to execute.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 562 of file DataPortal.cs.

◆ BeginExecute< T >() [2/2]

static void Csla.DataPortal< T >.BeginExecute< T > ( obj,
EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to execute a command object.

Template Parameters
TType of object to execute.
Parameters
objReference to the object to execute.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 585 of file DataPortal.cs.

◆ BeginFetch() [1/3]

void Csla.DataPortal< T >.BeginFetch ( )

Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database.

Implements Csla.IDataPortal< T >.

Definition at line 425 of file DataPortalT.cs.

◆ BeginFetch() [2/3]

void Csla.DataPortal< T >.BeginFetch ( object  criteria)

Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 437 of file DataPortalT.cs.

◆ BeginFetch() [3/3]

async void Csla.DataPortal< T >.BeginFetch ( object  criteria,
object  userState 
)

Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.
userStateUser state data.

Implements Csla.IDataPortal< T >.

Definition at line 450 of file DataPortalT.cs.

◆ BeginFetch< T >() [1/4]

static void Csla.DataPortal< T >.BeginFetch< T > ( EventHandler< DataPortalResult< T > >  callback)
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Parameters
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 253 of file DataPortal.cs.

◆ BeginFetch< T >() [2/4]

static void Csla.DataPortal< T >.BeginFetch< T > ( EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Parameters
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 273 of file DataPortal.cs.

◆ BeginFetch< T >() [3/4]

static void Csla.DataPortal< T >.BeginFetch< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback 
)
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Parameters
criteriaCriteria describing the object to fetch.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 295 of file DataPortal.cs.

◆ BeginFetch< T >() [4/4]

static void Csla.DataPortal< T >.BeginFetch< T > ( object  criteria,
EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Parameters
criteriaCriteria describing the object to fetch.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 318 of file DataPortal.cs.

◆ BeginUpdate() [1/2]

void Csla.DataPortal< T >.BeginUpdate ( obj)

Called by a factory method in a business class or by the UI to update an object.

Parameters
objObject to update.

Implements Csla.IDataPortal< T >.

Definition at line 736 of file DataPortalT.cs.

◆ BeginUpdate() [2/2]

async void Csla.DataPortal< T >.BeginUpdate ( obj,
object  userState 
)

Called by a factory method in a business class or by the UI to update an object.

Parameters
objObject to update.
userStateUser state data.

Implements Csla.IDataPortal< T >.

Definition at line 748 of file DataPortalT.cs.

◆ BeginUpdate< T >() [1/2]

static void Csla.DataPortal< T >.BeginUpdate< T > ( obj,
EventHandler< DataPortalResult< T > >  callback 
)
static

Starts an asynchronous data portal operation to update a business object.

Template Parameters
TType of business object to update.
Parameters
objBusiness object to update.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
Type Constraints
T :IMobileObject 

Definition at line 392 of file DataPortal.cs.

◆ BeginUpdate< T >() [2/2]

static void Csla.DataPortal< T >.BeginUpdate< T > ( obj,
EventHandler< DataPortalResult< T > >  callback,
object  userState 
)
static

Starts an asynchronous data portal operation to update a business object.

Template Parameters
TType of business object to update.
Parameters
objBusiness object to update.
callbackReference to method that will handle the asynchronous callback when the operation is complete.
userStateUser state object.
Type Constraints
T :IMobileObject 

Definition at line 415 of file DataPortal.cs.

◆ Create() [1/2]

T Csla.DataPortal< T >.Create ( params object[]  criteria)

Called by a factory method in a business class to create a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.
Returns
A new object, populated with default values.

Implements Csla.IDataPortal< T >.

Definition at line 141 of file DataPortalT.cs.

◆ Create() [2/2]

static object Csla.DataPortal< T >.Create ( Type  objectType,
object  criteria 
)
static

Called by a factory method in a business class to create a new object, which is loaded with default values from the database.

Parameters
objectTypeType of business object to create.
criteriaObject-specific criteria.
Returns
A new object, populated with default values.

Definition at line 91 of file DataPortal.cs.

◆ Create< T >() [1/2]

static T Csla.DataPortal< T >.Create< T > ( )
static

Called by a factory method in a business class to create a new object, which is loaded with default values from the database.

Template Parameters
TSpecific type of the business object.
Returns
A new object, populated with default values.

Definition at line 78 of file DataPortal.cs.

◆ Create< T >() [2/2]

static T Csla.DataPortal< T >.Create< T > ( params object[]  criteria)
static

Called by a factory method in a business class to create a new object, which is loaded with default values from the database.

Template Parameters
TSpecific type of the business object.
Parameters
criteriaObject-specific criteria.
Returns
A new object, populated with default values.

Definition at line 65 of file DataPortal.cs.

◆ CreateAsync()

async Task< T > Csla.DataPortal< T >.CreateAsync ( params object[]  criteria)

Called by a factory method in a business class or by the UI to create a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 168 of file DataPortalT.cs.

◆ CreateAsync< T >() [1/2]

static async Task< T > Csla.DataPortal< T >.CreateAsync< T > ( )
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.

Definition at line 189 of file DataPortal.cs.

◆ CreateAsync< T >() [2/2]

static async Task< T > Csla.DataPortal< T >.CreateAsync< T > ( params object[]  criteria)
static

Starts an asynchronous data portal operation to create a business object.

Template Parameters
TType of business object to create.
Parameters
criteriaCriteria describing the object to create.

Definition at line 205 of file DataPortal.cs.

◆ CreateChild< T >() [1/2]

static T Csla.DataPortal< T >.CreateChild< T > ( )
static

Creates and initializes a new child business object.

Template Parameters
TType of business object to create.

Definition at line 617 of file DataPortal.cs.

◆ CreateChild< T >() [2/2]

static T Csla.DataPortal< T >.CreateChild< T > ( params object[]  parameters)
static

Creates and initializes a new child business object.

Template Parameters
TType of business object to create.
Parameters
parametersParameters passed to child create method.

Definition at line 633 of file DataPortal.cs.

◆ CreateChildAsync< T >() [1/2]

static async Task< T > Csla.DataPortal< T >.CreateChildAsync< T > ( )
static

Creates and initializes a new child business object.

Template Parameters
TType of business object to create.

Definition at line 646 of file DataPortal.cs.

◆ CreateChildAsync< T >() [2/2]

static async Task< T > Csla.DataPortal< T >.CreateChildAsync< T > ( params object[]  parameters)
static

Creates and initializes a new child business object.

Template Parameters
TType of business object to create.
Parameters
parametersParameters passed to child create method.

Definition at line 662 of file DataPortal.cs.

◆ Delete()

void Csla.DataPortal< T >.Delete ( params object[]  criteria)

Called by a factory method in a business class or by the UI to delete an object.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 890 of file DataPortalT.cs.

◆ Delete< T >()

static void Csla.DataPortal< T >.Delete< T > ( params object[]  criteria)
static

Called by a Shared (static in C#) method in the business class to cause immediate deletion of a specific object from the database.

Parameters
criteriaObject-specific criteria.

Definition at line 445 of file DataPortal.cs.

◆ DeleteAsync()

async Task Csla.DataPortal< T >.DeleteAsync ( params object[]  criteria)

Called by a factory method in a business class or by the UI to delete an object.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 958 of file DataPortalT.cs.

◆ DeleteAsync< T >()

static async Task Csla.DataPortal< T >.DeleteAsync< T > ( params object[]  criteria)
static

Starts an asynchronous data portal operation to delete a business object.

Template Parameters
TType of business object to delete.
Parameters
criteriaCriteria describing the object to delete.
Type Constraints
T :IMobileObject 

Definition at line 513 of file DataPortal.cs.

◆ Execute()

T Csla.DataPortal< T >.Execute ( command)

Called by a factory method in a business class or by the UI to execute a command object.

Parameters
commandCommand object to execute.

Implements Csla.IDataPortal< T >.

Definition at line 984 of file DataPortalT.cs.

◆ Execute< T >()

static T Csla.DataPortal< T >.Execute< T > ( obj)
static

Called to execute a Command object on the server.

To be a Command object, the object must inherit from CommandBase.

Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object.

On the server, the Command object's DataPortal_Execute() method will be invoked and on an ObjectFactory the Execute method will be invoked. Write any server-side code in that method.

Template Parameters
TSpecific type of the Command object.
Parameters
objA reference to the Command object to be executed.
Returns
A reference to the updated Command object.

Definition at line 541 of file DataPortal.cs.

◆ ExecuteAsync()

async Task< T > Csla.DataPortal< T >.ExecuteAsync ( command)

Called by a factory method in a business class or by the UI to execute a command object.

Parameters
commandCommand object to execute.

Implements Csla.IDataPortal< T >.

Definition at line 1032 of file DataPortalT.cs.

◆ ExecuteAsync< T >()

static async Task< T > Csla.DataPortal< T >.ExecuteAsync< T > ( command)
static

Starts an asynchronous data portal operation to execute a command object.

Template Parameters
TType of object to execute.
Parameters
commandReference to the object to execute.
Type Constraints
T :IMobileObject 

Definition at line 603 of file DataPortal.cs.

◆ Fetch()

T Csla.DataPortal< T >.Fetch ( params object[]  criteria)

Called by a factory method in a business class to Fetch a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.
Returns
A new object, populated with default values.

Implements Csla.IDataPortal< T >.

Definition at line 387 of file DataPortalT.cs.

◆ Fetch< T >() [1/2]

static T Csla.DataPortal< T >.Fetch< T > ( )
static

Called by a factory method in a business class to retrieve an object, which is loaded with values from the database.

Template Parameters
TSpecific type of the business object.
Returns
An object populated with values from the database.

Definition at line 230 of file DataPortal.cs.

◆ Fetch< T >() [2/2]

static T Csla.DataPortal< T >.Fetch< T > ( params object[]  criteria)
static

Called by a factory method in a business class to retrieve an object, which is loaded with values from the database.

Template Parameters
TSpecific type of the business object.
Parameters
criteriaObject-specific criteria.
Returns
An object populated with values from the database.

Definition at line 218 of file DataPortal.cs.

◆ FetchAsync()

async Task< T > Csla.DataPortal< T >.FetchAsync ( params object[]  criteria)

Called by a factory method in a business class or by the UI to Fetch a new object, which is loaded with default values from the database.

Parameters
criteriaObject-specific criteria.

Implements Csla.IDataPortal< T >.

Definition at line 414 of file DataPortalT.cs.

◆ FetchAsync< T >() [1/2]

static async Task< T > Csla.DataPortal< T >.FetchAsync< T > ( )
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Type Constraints
T :IMobileObject 

Definition at line 333 of file DataPortal.cs.

◆ FetchAsync< T >() [2/2]

static async Task< T > Csla.DataPortal< T >.FetchAsync< T > ( params object[]  criteria)
static

Starts an asynchronous data portal operation to fetch a business object.

Template Parameters
TType of business object to fetch.
Parameters
criteriaCriteria describing the object to fetch.
Type Constraints
T :IMobileObject 

Definition at line 350 of file DataPortal.cs.

◆ FetchChild< T >() [1/2]

static T Csla.DataPortal< T >.FetchChild< T > ( )
static

Creates and loads an existing child business object.

Template Parameters
TType of business object to retrieve.

Definition at line 675 of file DataPortal.cs.

◆ FetchChild< T >() [2/2]

static T Csla.DataPortal< T >.FetchChild< T > ( params object[]  parameters)
static

Creates and loads an existing child business object.

Template Parameters
TType of business object to retrieve.
Parameters
parametersParameters passed to child fetch method.

Definition at line 691 of file DataPortal.cs.

◆ FetchChildAsync< T >() [1/2]

static async Task< T > Csla.DataPortal< T >.FetchChildAsync< T > ( )
static

Fetchs and initializes a new child business object.

Template Parameters
TType of business object to Fetch.

Definition at line 704 of file DataPortal.cs.

◆ FetchChildAsync< T >() [2/2]

static async Task< T > Csla.DataPortal< T >.FetchChildAsync< T > ( params object[]  parameters)
static

Fetchs and initializes a new child business object.

Template Parameters
TType of business object to Fetch.
Parameters
parametersParameters passed to child Fetch method.

Definition at line 720 of file DataPortal.cs.

◆ OnCreateCompleted()

virtual void Csla.DataPortal< T >.OnCreateCompleted ( DataPortalResult< T >  e)
protectedvirtual

Raises the event.

Parameters
eThe parameter provided to the event handler.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 216 of file DataPortalT.cs.

◆ OnDeleteCompleted()

virtual void Csla.DataPortal< T >.OnDeleteCompleted ( DataPortalResult< T >  e)
protectedvirtual

Raises the event.

Parameters
eThe parameter provided to the event handler.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 880 of file DataPortalT.cs.

◆ OnExecuteCompleted()

virtual void Csla.DataPortal< T >.OnExecuteCompleted ( DataPortalResult< T >  e)
protectedvirtual

Raises the ExecuteCompleted event.

Parameters
eEvent arguments.

Definition at line 974 of file DataPortalT.cs.

◆ OnFetchCompleted()

virtual void Csla.DataPortal< T >.OnFetchCompleted ( DataPortalResult< T >  e)
protectedvirtual

Raises the event.

Parameters
eThe parameter provided to the event handler.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 375 of file DataPortalT.cs.

◆ OnUpdateCompleted()

virtual void Csla.DataPortal< T >.OnUpdateCompleted ( DataPortalResult< T >  e)
protectedvirtual

Raises the event.

Parameters
eThe parameter provided to the event handler.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 705 of file DataPortalT.cs.

◆ ReleaseProxy()

static void Csla.DataPortal< T >.ReleaseProxy ( )
static

Releases any remote data portal proxy object, so the next data portal call will create a new proxy instance.

Definition at line 874 of file DataPortal.cs.

◆ ResetProxyFactory()

static void Csla.DataPortal< T >.ResetProxyFactory ( )
static

Resets the data portal proxy type, so the next data portal call will reload the proxy type based on current configuration values.

Definition at line 849 of file DataPortal.cs.

◆ ResetProxyType()

static void Csla.DataPortal< T >.ResetProxyType ( )
static

Resets the data portal proxy type, so the next data portal call will reload the proxy type based on current configuration values.

Definition at line 859 of file DataPortal.cs.

◆ Update()

T Csla.DataPortal< T >.Update ( obj)

Called by a factory method in a business class or by the UI to update an object.

Parameters
objObject to update.

Implements Csla.IDataPortal< T >.

Definition at line 715 of file DataPortalT.cs.

◆ Update< T >()

static T Csla.DataPortal< T >.Update< T > ( obj)
static

Called by the business object's Save() method to insert, update or delete an object in the database.

Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object.

Template Parameters
TSpecific type of the business object.
Parameters
objA reference to the business object to be updated.
Returns
A reference to the updated business object.

Definition at line 370 of file DataPortal.cs.

◆ UpdateAsync()

async Task< T > Csla.DataPortal< T >.UpdateAsync ( obj)

Called by a factory method in a business class or by the UI to update an object.

Parameters
objObject to update.

Implements Csla.IDataPortal< T >.

Definition at line 773 of file DataPortalT.cs.

◆ UpdateAsync< T >()

static async Task< T > Csla.DataPortal< T >.UpdateAsync< T > ( obj)
static

Starts an asynchronous data portal operation to update a business object.

Template Parameters
TType of business object to update.
Parameters
objBusiness object to update.
Type Constraints
T :IMobileObject 

Definition at line 433 of file DataPortal.cs.

◆ UpdateChild() [1/2]

static void Csla.DataPortal< T >.UpdateChild ( object  child)
static

Inserts, updates or deletes an existing child business object.

Parameters
childBusiness object to update.

Definition at line 733 of file DataPortal.cs.

◆ UpdateChild() [2/2]

static void Csla.DataPortal< T >.UpdateChild ( object  child,
params object[]  parameters 
)
static

Inserts, updates or deletes an existing child business object.

Parameters
childBusiness object to update.
parametersParameters passed to child update method.

Definition at line 749 of file DataPortal.cs.

◆ UpdateChildAsync() [1/2]

static async Task Csla.DataPortal< T >.UpdateChildAsync ( object  child)
static

Inserts, updates or deletes an existing child business object.

Parameters
childBusiness object to update.

Definition at line 762 of file DataPortal.cs.

◆ UpdateChildAsync() [2/2]

static async Task Csla.DataPortal< T >.UpdateChildAsync ( object  child,
params object[]  parameters 
)
static

Inserts, updates or deletes an existing child business object.

Parameters
childBusiness object to update.
parametersParameters passed to child update method.

Definition at line 778 of file DataPortal.cs.

Property Documentation

◆ GlobalContext

Csla.Core.ContextDictionary Csla.DataPortal< T >.GlobalContext
getset

Gets a reference to the global context returned from the background thread and/or server.

Definition at line 29 of file DataPortalT.cs.

◆ ProxyFactory

Gets or sets a reference to a ProxyFactory object that is used to create an instance of the data portal proxy object.

Definition at line 814 of file DataPortal.cs.

◆ ProxyTypeName

string Csla.DataPortal< T >.ProxyTypeName
staticgetset

Gets or sets the assembly qualified type name of the proxy object to be loaded by the data portal.

"Local" is a special value used to indicate that the data portal should run in local mode.

Deprecated: use ApplicationContext.DataPortalProxy

Definition at line 838 of file DataPortal.cs.

Event Documentation

◆ CreateCompleted

EventHandler<DataPortalResult<T> > Csla.DataPortal< T >.CreateCompleted

Event raised when the operation has completed.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 192 of file DataPortalT.cs.

◆ DataPortalInitInvoke

Action<System.Object> Csla.DataPortal< T >.DataPortalInitInvoke
static

Raised by DataPortal before it starts setting up to call a server-side DataPortal method.

Definition at line 28 of file DataPortal.cs.

◆ DataPortalInvoke

Action<DataPortalEventArgs> Csla.DataPortal< T >.DataPortalInvoke
static

Raised by DataPortal prior to calling the requested server-side DataPortal method.

Definition at line 34 of file DataPortal.cs.

◆ DataPortalInvokeComplete

Action<DataPortalEventArgs> Csla.DataPortal< T >.DataPortalInvokeComplete
static

Raised by DataPortal after the requested server-side DataPortal method call is complete.

Definition at line 40 of file DataPortal.cs.

◆ DeleteCompleted

EventHandler<DataPortalResult<T> > Csla.DataPortal< T >.DeleteCompleted

Event raised when the operation has completed.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 856 of file DataPortalT.cs.

◆ ExecuteCompleted

EventHandler<DataPortalResult<T> > Csla.DataPortal< T >.ExecuteCompleted

Event indicating an execute operation is complete.

Definition at line 967 of file DataPortalT.cs.

◆ FetchCompleted

EventHandler<DataPortalResult<T> > Csla.DataPortal< T >.FetchCompleted

Event raised when the operation has completed.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 351 of file DataPortalT.cs.

◆ UpdateCompleted

EventHandler<DataPortalResult<T> > Csla.DataPortal< T >.UpdateCompleted

Event raised when the operation has completed.

If your application is running in WPF, this event will be raised on the UI thread automatically.

If your application is running in Windows Forms, this event will be raised on a background thread. If you also set DataPortal.SynchronizationObject to a Windows Forms form or control, then the event will be raised on the UI thread automatically.

In any other environment (such as ASP.NET), this event will be raised on a background thread.

Definition at line 681 of file DataPortalT.cs.