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.CommandBase< T > Class Template Reference

This is the base class from which command objects will be derived. More...

Inheritance diagram for Csla.CommandBase< T >:
Csla.Core.ManagedObjectBase Csla.Core.ICommandObject Csla.ICommandBase Csla.Serialization.Mobile.IMobileObject Csla.Core.IBusinessObject Csla.Core.ICommandObject Csla.Serialization.Mobile.IMobileObject Csla.Core.IBusinessObject Csla.Core.MobileObject

Public Member Functions

 CommandBase ()
 Creates an instance of the object. More...
 
Clone ()
 Creates a clone of the object. More...
 

Protected Member Functions

virtual void Initialize ()
 Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. More...
 
virtual void DataPortal_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during server-side processing. More...
 
virtual object GetClone ()
 Creates a clone of the object. More...
 
- Protected Member Functions inherited from Csla.Core.ManagedObjectBase
ReadPropertyConvert< F, P > (PropertyInfo< F > propertyInfo)
 Gets a property's value from the list of managed field values, converting the value to an appropriate type. More...
 
ReadProperty< P > (PropertyInfo< P > propertyInfo)
 Gets a property's value as a specified type. More...
 
void LoadPropertyConvert< P, F > (PropertyInfo< P > propertyInfo, F newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
void LoadProperty< P > (PropertyInfo< P > propertyInfo, P newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
void OnPropertyChanged (string propertyName)
 Raises the PropertyChanged event. More...
 
void OnPropertyChanged (IPropertyInfo propertyInfo)
 Raises the PropertyChanged event. More...
 
override void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to manually retrieve child object data from the serializations stream. More...
 
override void OnSetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to manually serialize child objects into the serialization stream. More...
 
virtual void OnDeserialized (System.Runtime.Serialization.StreamingContext context)
 This method is called on a newly deserialized object after deserialization is complete. More...
 
- Protected Member Functions inherited from Csla.Core.MobileObject
virtual void OnGetState (SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialzation stream. More...
 
virtual void OnSetState (SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from the MobileFormatter serialzation stream. More...
 

Static Protected Member Functions

static PropertyInfo< P > RegisterProperty< P > (PropertyInfo< P > info)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName, P defaultValue, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, P defaultValue, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
- Static Protected Member Functions inherited from Csla.Core.ManagedObjectBase
static PropertyInfo< P > RegisterProperty< P > (Type objectType, PropertyInfo< P > info)
 Indicates that the specified property belongs to the type. More...
 
static PropertyInfo< P > RegisterProperty< T, P > (Expression< Func< T, object > > propertyLambdaExpression)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< T, P > (Expression< Func< T, object > > propertyLambdaExpression, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< T, P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< T, P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 

Additional Inherited Members

- Properties inherited from Csla.Core.ManagedObjectBase
FieldDataManager FieldManager [get]
 Gets a reference to the field mananger for this object. More...
 
- Properties inherited from Csla.Core.IBusinessObject
int Identity [get]
 Gets a value representing this object instance's unique identity value within the business object graph. More...
 

Detailed Description

This is the base class from which command objects will be derived.

Command objects allow the execution of arbitrary server-side functionality. Most often, this involves the invocation of a stored procedure in the database, but can involve any other type of stateless, atomic call to the server instead.

To implement a command object, inherit from CommandBase and override the DataPortal_Execute method. In this method you can implement any server-side code as required.

To pass data to/from the server, use instance variables within the command object itself. The command object is instantiated on the client, and is passed by value to the server where the DataPortal_Execute method is invoked. The command object is then returned to the client by value.

Type Constraints
T :CommandBase<T> 

Definition at line 46 of file CommandBase.cs.

Constructor & Destructor Documentation

◆ CommandBase()

Creates an instance of the object.

Definition at line 55 of file CommandBase.cs.

Member Function Documentation

◆ Clone()

T Csla.CommandBase< T >.Clone ( )

Creates a clone of the object.

Returns
A new object containing the exact data of the original object.

Definition at line 219 of file CommandBase.cs.

◆ DataPortal_OnDataPortalException()

virtual void Csla.CommandBase< T >.DataPortal_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

Called by the server-side DataPortal if an exception occurs during server-side processing.

Parameters
eThe DataPortalContext object passed to the DataPortal.
exThe Exception thrown during processing.

Definition at line 147 of file CommandBase.cs.

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.CommandBase< T >.DataPortal_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 122 of file CommandBase.cs.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.CommandBase< T >.DataPortal_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal after calling the requested DataPortal_xyz method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 134 of file CommandBase.cs.

◆ GetClone()

virtual object Csla.CommandBase< T >.GetClone ( )
protectedvirtual

Creates a clone of the object.

Returns
A new object containing the exact data of the original object.

Definition at line 208 of file CommandBase.cs.

◆ Initialize()

virtual void Csla.CommandBase< T >.Initialize ( )
protectedvirtual

Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code.

Definition at line 67 of file CommandBase.cs.

◆ RegisterProperty< P >() [1/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
Returns

Definition at line 265 of file CommandBase.cs.

◆ RegisterProperty< P >() [2/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
defaultValueDefault Value for the property
Returns

Definition at line 280 of file CommandBase.cs.

◆ RegisterProperty< P >() [3/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
relationshipRelationship with property value.
Returns

Definition at line 308 of file CommandBase.cs.

◆ RegisterProperty< P >() [4/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
Returns

Definition at line 335 of file CommandBase.cs.

◆ RegisterProperty< P >() [5/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
Returns

Definition at line 381 of file CommandBase.cs.

◆ RegisterProperty< P >() [6/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
defaultValue,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
relationshipRelationship with property value.
Returns

Definition at line 412 of file CommandBase.cs.

◆ RegisterProperty< P >() [7/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
relationshipRelationship with property value.
Returns

Definition at line 351 of file CommandBase.cs.

◆ RegisterProperty< P >() [8/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( PropertyInfo< P >  info)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property.
Parameters
infoPropertyInfo object for the property.
Returns
The provided IPropertyInfo object.

Definition at line 241 of file CommandBase.cs.

◆ RegisterProperty< P >() [9/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( string  propertyName)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
Returns

Definition at line 253 of file CommandBase.cs.

◆ RegisterProperty< P >() [10/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( string  propertyName,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
relationshipRelationship with property value.
Returns

Definition at line 295 of file CommandBase.cs.

◆ RegisterProperty< P >() [11/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
Returns

Definition at line 322 of file CommandBase.cs.

◆ RegisterProperty< P >() [12/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
Returns

Definition at line 367 of file CommandBase.cs.

◆ RegisterProperty< P >() [13/13]

static PropertyInfo< P > Csla.CommandBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName,
defaultValue,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
relationshipRelationship with property value.
Returns

Definition at line 397 of file CommandBase.cs.