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.Reflection.LateBoundObject Class Reference

Enables simple invocation of methods against the contained object using late binding. More...

Inherited by Csla.Server.DataPortalTarget.

Public Member Functions

 LateBoundObject (Type objectType)
 Creates an instance of the specified type and contains it within a new LateBoundObject. More...
 
 LateBoundObject (object instance)
 Contains the provided object within a new LateBoundObject. More...
 
object CallMethodIfImplemented (string method)
 Uses reflection to dynamically invoke a method if that method is implemented on the target object. More...
 
object CallMethodIfImplemented (string method, params object[] parameters)
 Uses reflection to dynamically invoke a method if that method is implemented on the target object. More...
 
object CallMethod (string method)
 Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object. More...
 
object CallMethod (string method, params object[] parameters)
 Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object. More...
 
async Task CallMethodTryAsync (string methodName)
 Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method. More...
 
async Task CallMethodTryAsync (string methodName, params object[] parameters)
 Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method. More...
 
async Task CallMethodTryAsyncDI< T > (bool isSync, params object[] parameters)
 Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method. More...
 

Properties

object Instance [get]
 Object instance managed by LateBoundObject. More...
 

Detailed Description

Enables simple invocation of methods against the contained object using late binding.

Definition at line 19 of file LateBoundObject.cs.

Constructor & Destructor Documentation

◆ LateBoundObject() [1/2]

Csla.Reflection.LateBoundObject.LateBoundObject ( Type  objectType)

Creates an instance of the specified type and contains it within a new LateBoundObject.

Parameters
objectTypeType of object to create.

The specified type must implement a default constructor.

Definition at line 38 of file LateBoundObject.cs.

◆ LateBoundObject() [2/2]

Csla.Reflection.LateBoundObject.LateBoundObject ( object  instance)

Contains the provided object within a new LateBoundObject.

Parameters
instanceObject to contain.

Definition at line 49 of file LateBoundObject.cs.

Member Function Documentation

◆ CallMethod() [1/2]

object Csla.Reflection.LateBoundObject.CallMethod ( string  method)

Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object.

Parameters
methodName of the method.

Definition at line 89 of file LateBoundObject.cs.

◆ CallMethod() [2/2]

object Csla.Reflection.LateBoundObject.CallMethod ( string  method,
params object[]  parameters 
)

Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object.

Parameters
methodName of the method.
parametersParameters to pass to method.

Definition at line 105 of file LateBoundObject.cs.

◆ CallMethodIfImplemented() [1/2]

object Csla.Reflection.LateBoundObject.CallMethodIfImplemented ( string  method)

Uses reflection to dynamically invoke a method if that method is implemented on the target object.

Parameters
methodName of the method.

Definition at line 61 of file LateBoundObject.cs.

◆ CallMethodIfImplemented() [2/2]

object Csla.Reflection.LateBoundObject.CallMethodIfImplemented ( string  method,
params object[]  parameters 
)

Uses reflection to dynamically invoke a method if that method is implemented on the target object.

Parameters
methodName of the method.
parametersParameters to pass to method.

Definition at line 76 of file LateBoundObject.cs.

◆ CallMethodTryAsync() [1/2]

async Task Csla.Reflection.LateBoundObject.CallMethodTryAsync ( string  methodName)

Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method.

Parameters
methodNameName of the method.
Returns

Definition at line 117 of file LateBoundObject.cs.

◆ CallMethodTryAsync() [2/2]

async Task Csla.Reflection.LateBoundObject.CallMethodTryAsync ( string  methodName,
params object[]  parameters 
)

Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method.

Parameters
methodNameName of the method.
parametersParameters to pass to method.

Definition at line 142 of file LateBoundObject.cs.

◆ CallMethodTryAsyncDI< T >()

async Task Csla.Reflection.LateBoundObject.CallMethodTryAsyncDI< T > ( bool  isSync,
params object[]  parameters 
)

Invokes a method using the await keyword if the method returns Task, otherwise synchronously invokes the method.

Parameters
isSyncIs client calling this synchronously
parametersParameters to pass to method.
Type Constraints
T :DataPortalOperationAttribute 

Definition at line 167 of file LateBoundObject.cs.

Property Documentation

◆ Instance

object Csla.Reflection.LateBoundObject.Instance
get

Object instance managed by LateBoundObject.

Definition at line 24 of file LateBoundObject.cs.