CSLA.NET 6.0.0
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...

Inheritance diagram for Csla.Reflection.LateBoundObject:
Csla.Core.IUseApplicationContext

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...
 
- Properties inherited from Csla.Core.IUseApplicationContext
ApplicationContext ApplicationContext [getset]
 Gets or sets the current ApplicationContext object. 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 41 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 53 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 93 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 109 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 65 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 80 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 121 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 146 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 182 of file LateBoundObject.cs.

Property Documentation

◆ Instance

object Csla.Reflection.LateBoundObject.Instance
get

Object instance managed by LateBoundObject.

Definition at line 27 of file LateBoundObject.cs.