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.IDataPortal< T > Interface Template Reference

Interface defining the members of the data portal type. More...

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

Public Member Functions

Task< T > CreateAsync (params object[] criteria)
 Starts an asynchronous data portal operation to create a business object. More...
 
Task< T > FetchAsync (params object[] criteria)
 Starts an asynchronous data portal operation to create a business object. More...
 
Task< T > UpdateAsync (T obj)
 Called by a factory method in a business class or by the UI to update an object. More...
 
Task< T > ExecuteAsync (T command)
 Called by a factory method in a business class or by the UI to execute a command object. More...
 
Task DeleteAsync (params object[] criteria)
 Called by a factory method in a business class or by the UI to delete an object. More...
 
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...
 
Fetch (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...
 
Execute (T obj)
 Called to execute a Command object on the server. More...
 
Update (T obj)
 Called by the business object's Save() method to insert, update or delete an object in the database. More...
 
void Delete (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...
 
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...
 
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...
 
void BeginFetch ()
 Called by a factory method in a business class or by the UI to retrieve an existing object, which is loaded with values from the database. More...
 
void BeginFetch (object criteria)
 Called by a factory method in a business class or by the UI to retrieve an existing object, which is loaded with values from the database. More...
 
void BeginFetch (object criteria, object userState)
 Called by a factory method in a business class or by the UI to retrieve an existing object, which is loaded with values from the database. More...
 
void BeginUpdate (T obj)
 Called by a factory method in a business class or by the UI to update an object. More...
 
void BeginUpdate (T obj, object userState)
 Called by a factory method in a business class or by the UI to update 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...
 
void BeginDelete (object criteria, object userState)
 Called by a factory method in a business class or by the UI to delete an 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...
 
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...
 

Properties

Csla.Core.ContextDictionary GlobalContext [get]
 Gets a reference to the global context returned from the background thread and/or server. More...
 

Events

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

Interface defining the members of the data portal type.

Template Parameters
T

Definition at line 20 of file IDataPortal.cs.

Member Function Documentation

◆ BeginCreate() [1/3]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginCreate() [2/3]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginCreate() [3/3]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginDelete() [1/2]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginDelete() [2/2]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginExecute() [1/2]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginExecute() [2/2]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ BeginFetch() [1/3]

void Csla.IDataPortal< T >.BeginFetch ( )

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

Implemented in Csla.DataPortal< T >.

◆ BeginFetch() [2/3]

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

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

Parameters
criteriaObject-specific criteria.

Implemented in Csla.DataPortal< T >.

◆ BeginFetch() [3/3]

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

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

Parameters
criteriaObject-specific criteria.
userStateUser state data.

Implemented in Csla.DataPortal< T >.

◆ BeginUpdate() [1/2]

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

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

Parameters
objObject to update.

Implemented in Csla.DataPortal< T >.

◆ BeginUpdate() [2/2]

void Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ Create()

T Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ CreateAsync()

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

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

Parameters
criteriaCriteria describing the object to create.

Implemented in Csla.DataPortal< T >.

◆ Delete()

void Csla.IDataPortal< T >.Delete ( 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.

Parameters
criteriaObject-specific criteria.

Implemented in Csla.DataPortal< T >.

◆ DeleteAsync()

Task Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ Execute()

T Csla.IDataPortal< T >.Execute ( obj)

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.

Parameters
objA reference to the Command object to be executed.
Returns
A reference to the updated Command object.

Implemented in Csla.DataPortal< T >.

◆ ExecuteAsync()

Task< T > Csla.IDataPortal< 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.

Implemented in Csla.DataPortal< T >.

◆ Fetch()

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

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

Parameters
criteriaObject-specific criteria.
Returns
An object populated with values from the database.

Implemented in Csla.DataPortal< T >.

◆ FetchAsync()

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

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

Parameters
criteriaCriteria describing the object to create.

Implemented in Csla.DataPortal< T >.

◆ Update()

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

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.

Parameters
objA reference to the business object to be updated.
Returns
A reference to the updated business object.

Implemented in Csla.DataPortal< T >.

◆ UpdateAsync()

Task< T > Csla.IDataPortal< T >.UpdateAsync ( obj)

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

Parameters
objObject to update.

Implemented in Csla.DataPortal< T >.

Property Documentation

◆ GlobalContext

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

Definition at line 115 of file IDataPortal.cs.

Event Documentation

◆ CreateCompleted

EventHandler<DataPortalResult<T> > Csla.IDataPortal< 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 135 of file IDataPortal.cs.

◆ DeleteCompleted

EventHandler<DataPortalResult<T> > Csla.IDataPortal< 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 258 of file IDataPortal.cs.

◆ ExecuteCompleted

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

Event indicating an execute operation is complete.

Definition at line 278 of file IDataPortal.cs.

◆ FetchCompleted

EventHandler<DataPortalResult<T> > Csla.IDataPortal< 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 179 of file IDataPortal.cs.

◆ UpdateCompleted

EventHandler<DataPortalResult<T> > Csla.IDataPortal< 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 223 of file IDataPortal.cs.