CSLA .NET 10.0.0
A home for your business logic
Loading...
Searching...
No Matches
Csla.Server.ObjectFactory Class Referenceabstract

Base class to be used when creating a data portal factory object. More...

Inheritance diagram for Csla.Server.ObjectFactory:
Csla.Core.GraphMerger

Public Member Functions

 ObjectFactory (ApplicationContext applicationContext)
 Creates an instance of the type.

Protected Member Functions

void SetIsReadOnly (object obj, bool value)
 Sets the IsReadOnly property on the specified object, if possible.
void CheckRules (object obj)
 Calls the ValidationRules.CheckRules() method on the specified object, if possible.
async Task CheckRulesAsync (object obj)
 Calls the ValidationRules.CheckRules() method on the specified object, if possible.
async Task WaitForIdle (object obj)
 Calls the WaitForIdle() method on the specified object with the default timeout, if possible.
async Task WaitForIdle (object obj, CancellationToken ct)
 Calls the WaitForIdle() method on the specified object with the given timeout, if possible.
void MarkOld (object obj)
 Calls the MarkOld method on the specified object, if possible.
void MarkNew (object obj)
 Calls the MarkNew method on the specified object, if possible.
void MarkAsChild (object obj)
 Calls the MarkAsChild method on the specified object, if possible.
void LoadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (object obj, PropertyInfo< P > propertyInfo, P? newValue)
 Loads a property's managed field with the supplied value.
void LoadProperty (object obj, IPropertyInfo propertyInfo, object? newValue)
 Loads a property's managed field with the supplied value.
P? ReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (object obj, PropertyInfo< P > propertyInfo)
 Reads a property's managed field value.
object? ReadProperty (object obj, IPropertyInfo propertyInfo)
 Reads a property's managed field value.
IDisposable BypassPropertyChecks (BusinessBase businessObject)
 By wrapping this property inside Using block you can set property values on businessObject business object without raising PropertyChanged events and checking user rights.
bool FieldExists (object obj, IPropertyInfo property)
 Gets a value indicating whether a managed field exists for the specified property.
Csla.Core.MobileList< C > GetDeletedList<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] C > (object obj)
 Gets the list of deleted items from an editable collection.

Properties

ApplicationContext ApplicationContext [get, set]
 Gets a reference to the current ApplicationContext.

Detailed Description

Base class to be used when creating a data portal factory object.

Constructor & Destructor Documentation

◆ ObjectFactory()

Csla.Server.ObjectFactory.ObjectFactory ( ApplicationContext applicationContext)
inline

Creates an instance of the type.

Parameters
applicationContextThe application context.
Exceptions
ArgumentNullExceptionapplicationContext is null.

Member Function Documentation

◆ BypassPropertyChecks()

IDisposable Csla.Server.ObjectFactory.BypassPropertyChecks ( BusinessBase businessObject)
inlineprotected

By wrapping this property inside Using block you can set property values on businessObject business object without raising PropertyChanged events and checking user rights.

Parameters
businessObjectObject on with you would like to set property values
Returns
An instance of IDisposable object that allows bypassing of normal authorization checks during property setting.
Exceptions
ArgumentNullExceptionbusinessObject is null.

◆ CheckRules()

void Csla.Server.ObjectFactory.CheckRules ( object obj)
inlineprotected

Calls the ValidationRules.CheckRules() method on the specified object, if possible.

Parameters
objObject on which to call the method.
Exceptions
ArgumentNullExceptionobj is null.

◆ CheckRulesAsync()

async Task Csla.Server.ObjectFactory.CheckRulesAsync ( object obj)
inlineprotected

Calls the ValidationRules.CheckRules() method on the specified object, if possible.

Parameters
objObject on which to call the method.
Exceptions
ArgumentNullExceptionobj is null.

◆ FieldExists()

bool Csla.Server.ObjectFactory.FieldExists ( object obj,
IPropertyInfo property )
inlineprotected

Gets a value indicating whether a managed field exists for the specified property.

Parameters
objBusiness object.
propertyProperty info object.
Exceptions
ArgumentNullExceptionobj or property is null.

◆ GetDeletedList<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] C >()

Csla.Core.MobileList< C > Csla.Server.ObjectFactory.GetDeletedList<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] C > ( object obj)
inlineprotected

Gets the list of deleted items from an editable collection.

Template Parameters
CType of child objects in the collection.
Parameters
objEditable collection object.
Exceptions
ArgumentNullExceptionobj is null.

◆ LoadProperty()

void Csla.Server.ObjectFactory.LoadProperty ( object obj,
IPropertyInfo propertyInfo,
object? newValue )
inlineprotected

Loads a property's managed field with the supplied value.

Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

◆ LoadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >()

void Csla.Server.ObjectFactory.LoadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( object obj,
PropertyInfo< P > propertyInfo,
P? newValue )
inlineprotected

Loads a property's managed field with the supplied value.

Template Parameters
PType of the property.
Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

◆ MarkAsChild()

void Csla.Server.ObjectFactory.MarkAsChild ( object obj)
inlineprotected

Calls the MarkAsChild method on the specified object, if possible.

Parameters
objObject on which to call the method.
Exceptions
ArgumentNullExceptionobj is null.

◆ MarkNew()

void Csla.Server.ObjectFactory.MarkNew ( object obj)
inlineprotected

Calls the MarkNew method on the specified object, if possible.

Parameters
objObject on which to call the method.
Exceptions
ArgumentNullExceptionobj is null.

◆ MarkOld()

void Csla.Server.ObjectFactory.MarkOld ( object obj)
inlineprotected

Calls the MarkOld method on the specified object, if possible.

Parameters
objObject on which to call the method.
Exceptions
ArgumentNullExceptionobj is null.

◆ ReadProperty()

object? Csla.Server.ObjectFactory.ReadProperty ( object obj,
IPropertyInfo propertyInfo )
inlineprotected

Reads a property's managed field value.

Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.

No authorization checks occur when this method is called.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

◆ ReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >()

P? Csla.Server.ObjectFactory.ReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( object obj,
PropertyInfo< P > propertyInfo )
inlineprotected

Reads a property's managed field value.

Template Parameters
P
Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.

No authorization checks occur when this method is called.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

◆ SetIsReadOnly()

void Csla.Server.ObjectFactory.SetIsReadOnly ( object obj,
bool value )
inlineprotected

Sets the IsReadOnly property on the specified object, if possible.

Parameters
objObject on which to operate.
valueNew value for IsReadOnly.
Exceptions
ArgumentNullExceptionobj is null.

◆ WaitForIdle() [1/2]

async Task Csla.Server.ObjectFactory.WaitForIdle ( object obj)
inlineprotected

Calls the WaitForIdle() method on the specified object with the default timeout, if possible.

Parameters
objObject on which to call the method.
Returns
void
Exceptions
ArgumentNullExceptionobj is null.

◆ WaitForIdle() [2/2]

async Task Csla.Server.ObjectFactory.WaitForIdle ( object obj,
CancellationToken ct )
inlineprotected

Calls the WaitForIdle() method on the specified object with the given timeout, if possible.

Parameters
objObject on which to call the method.
ctThe cancellation token.
Returns
void
Exceptions
ArgumentNullExceptionobj is null.

Property Documentation

◆ ApplicationContext

ApplicationContext Csla.Server.ObjectFactory.ApplicationContext
getsetprotected

Gets a reference to the current ApplicationContext.


The documentation for this class was generated from the following file: