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.Server.ObjectFactory Class Reference

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

Inheritance diagram for Csla.Server.ObjectFactory:
Csla.Analyzers.IntegrationTests.B Csla.Core.GraphMerger Csla.Test.BypassPropertyChecks.TestObjectFactory Csla.Test.CommandBase.CommandBaseTest Csla.Test.DataPortal.FactoryBusyFactory Csla.Test.DataPortalTest.SingleWithFactoryFactory Csla.Test.ObjectFactory.CommandObjectFactory Csla.Test.ObjectFactory.RootFactory Csla.Test.ObjectFactory.RootFactory1 Csla.Test.ObjectFactory.RootFactory3 Csla.Test.ObjectFactory.RootFactory4 Csla.Test.ObjectFactory.RootFactory5 Csla.Test.ObjectFactory.RootFactoryC Csla.Testing.Business.ObjectFactory.ObjectFactoryBusinessItemFactory

Public Member Functions

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

Protected Member Functions

void SetIsReadOnly (object obj, bool value)
 Sets the IsReadOnly property on the specified object, if possible. More...
 
void CheckRules (object obj)
 Calls the ValidationRules.CheckRules() method on the specified object, if possible. More...
 
void MarkOld (object obj)
 Calls the MarkOld method on the specified object, if possible. More...
 
void MarkNew (object obj)
 Calls the MarkNew method on the specified object, if possible. More...
 
void MarkAsChild (object obj)
 Calls the MarkAsChild method on the specified object, if possible. More...
 
void LoadProperty< P > (object obj, PropertyInfo< P > propertyInfo, P newValue)
 Loads a property's managed field with the supplied value. More...
 
void LoadProperty (object obj, IPropertyInfo propertyInfo, object newValue)
 Loads a property's managed field with the supplied value. More...
 
ReadProperty< P > (object obj, PropertyInfo< P > propertyInfo)
 Reads a property's managed field value. More...
 
object ReadProperty (object obj, IPropertyInfo propertyInfo)
 Reads a property's managed field value. More...
 
IDisposable BypassPropertyChecks (Csla.Core.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. More...
 
bool FieldExists (object obj, Csla.Core.IPropertyInfo property)
 Gets a value indicating whether a managed field exists for the specified property. More...
 
Csla.Core.MobileList< C > GetDeletedList< C > (object obj)
 Gets the list of deleted items from an editable collection. More...
 

Properties

ApplicationContext ApplicationContext [getset]
 Gets a reference to the current ApplicationContext. More...
 

Detailed Description

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

Definition at line 19 of file ObjectFactory.cs.

Constructor & Destructor Documentation

◆ ObjectFactory()

Csla.Server.ObjectFactory.ObjectFactory ( ApplicationContext  applicationContext)

Creates an instance of the type.

Parameters
applicationContext

Definition at line 25 of file ObjectFactory.cs.

Member Function Documentation

◆ BypassPropertyChecks()

IDisposable Csla.Server.ObjectFactory.BypassPropertyChecks ( Csla.Core.BusinessBase  businessObject)
protected

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.

Definition at line 215 of file ObjectFactory.cs.

◆ CheckRules()

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

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

Parameters
objObject on which to call the method.

Definition at line 55 of file ObjectFactory.cs.

◆ FieldExists()

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

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

Parameters
objBusiness object.
propertyProperty info object.

Definition at line 226 of file ObjectFactory.cs.

◆ GetDeletedList< C >()

Csla.Core.MobileList< C > Csla.Server.ObjectFactory.GetDeletedList< C > ( object  obj)
protected

Gets the list of deleted items from an editable collection.

Template Parameters
CType of child objects in the colletion.
Parameters
objEditable collection object.

Definition at line 241 of file ObjectFactory.cs.

◆ LoadProperty()

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

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.

Definition at line 152 of file ObjectFactory.cs.

◆ LoadProperty< P >()

void Csla.Server.ObjectFactory.LoadProperty< P > ( object  obj,
PropertyInfo< P >  propertyInfo,
newValue 
)
protected

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.

Definition at line 131 of file ObjectFactory.cs.

◆ MarkAsChild()

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

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

Parameters
objObject on which to call the method.

Definition at line 103 of file ObjectFactory.cs.

◆ MarkNew()

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

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

Parameters
objObject on which to call the method.

Definition at line 87 of file ObjectFactory.cs.

◆ MarkOld()

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

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

Parameters
objObject on which to call the method.

Definition at line 71 of file ObjectFactory.cs.

◆ ReadProperty()

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

Reads a property's managed field value.

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

No authorization checks occur when this method is called.

Definition at line 191 of file ObjectFactory.cs.

◆ ReadProperty< P >()

P Csla.Server.ObjectFactory.ReadProperty< P > ( object  obj,
PropertyInfo< P >  propertyInfo 
)
protected

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.

Definition at line 173 of file ObjectFactory.cs.

◆ SetIsReadOnly()

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

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

Parameters
objObject on which to operate.
valueNew value for IsReadOnly.

Definition at line 41 of file ObjectFactory.cs.

Property Documentation

◆ ApplicationContext

ApplicationContext Csla.Server.ObjectFactory.ApplicationContext
getsetprotected

Gets a reference to the current ApplicationContext.

Definition at line 33 of file ObjectFactory.cs.