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

This is the non-generic base class from which most business objects will be derived. More...

Inheritance diagram for Csla.Core.BusinessBase:
Csla.Serialization.Mobile.ISerializationNotification Csla.Core.INotifyChildChanged Csla.Core.ICheckRules Csla.Rules.IHostRules Csla.Core.IParent Csla.Security.IAuthorizeReadWrite Csla.Core.IEditableBusinessObject Csla.Core.UndoableBase Csla.BusinessBase< T >

Classes

class  BypassPropertyChecksObject
 Class that allows setting of property values on current business object without raising PropertyChanged events and checking user rights.

Public Member Functions

virtual bool CanReadProperty (IPropertyInfo property)
 Returns true if the user is allowed to read the calling property.
bool CanReadProperty (IPropertyInfo property, bool throwOnFalse)
 Returns true if the user is allowed to read the calling property.
bool CanReadProperty (string propertyName)
 Returns true if the user is allowed to read the specified property.
virtual bool CanWriteProperty (IPropertyInfo property)
 Returns true if the user is allowed to write the specified property.
bool CanWriteProperty (IPropertyInfo property, bool throwOnFalse)
 Returns true if the user is allowed to write the calling property.
bool CanWriteProperty (string propertyName)
 Returns true if the user is allowed to write the specified property.
virtual bool CanExecuteMethod (IMemberInfo method)
 Returns true if the user is allowed to execute the specified method.
bool CanExecuteMethod (IMemberInfo method, bool throwOnFalse)
 Returns true if the user is allowed to execute the specified method.
virtual bool CanExecuteMethod (string methodName)
 Returns true if the user is allowed to execute the specified method.
void BeginEdit ()
 Starts a nested edit on the object.
void CancelEdit ()
 Cancels the current edit process, restoring the object's state to its previous values.
void ApplyEdit ()
 Commits the current edit process.
virtual void Delete ()
 Marks the object for deletion. The object will be deleted as part of the next save operation.
async Task WaitForIdle ()
 Await this method to ensure business object is not busy.
Task WaitForIdle (TimeSpan timeout)
 Await this method to ensure business object is not busy.
virtual Task WaitForIdle (CancellationToken ct)
 Await this method to ensure the business object is not busy.
virtual bool IsPropertyBusy (IPropertyInfo property)
 Gets a value indicating whether a specific property is busy (has a currently executing async rule).
bool IsPropertyBusy (string propertyName)
 Gets a value indicating whether a specific property is busy (has a currently executing async rule).
BrokenRulesCollection GetBrokenRules ()
 Gets the broken rules for this object.
Public Member Functions inherited from Csla.Security.IAuthorizeReadWrite
bool CanWriteProperty (Core.IPropertyInfo property)
 Returns true if the user is allowed to write the to the specified property.
bool CanReadProperty (Core.IPropertyInfo property)
 Returns true if the user is allowed to read the specified property.
bool CanExecuteMethod (Core.IMemberInfo method)
 Returns true if the user is allowed to execute the specified method.
Public Member Functions inherited from Csla.Rules.IHostRules
void RuleStart (Core.IPropertyInfo property)
 Indicates that a rule has started processing.
void RuleComplete (Core.IPropertyInfo property)
 Indicates that a rule has finished processing.

Protected Member Functions

 BusinessBase ()
 Creates an instance of the type.
override void OnApplicationContextSet ()
 Method invoked after ApplicationContext is available.
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.
virtual void SetParent (IParent? parent)
 Used by BusinessListBase as a child object is created to tell the child object about its parent.
virtual void MarkNew ()
 Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion.
virtual void MarkOld ()
 Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty).
void MarkDeleted ()
 Marks an object for deletion. This also marks the object as being dirty.
override void OnGetMetastate (System.IO.BinaryWriter writer)
override void OnSetMetastate (System.IO.BinaryReader reader)
void MarkDirty ()
 Marks an object as being dirty, or changed.
void MarkDirty (bool suppressEvent)
 Marks an object as being dirty, or changed.
virtual void PropertyHasChanged (IPropertyInfo property)
 Performs processing required when a property has changed.
virtual void MetaPropertyHasChanged (string name)
 Raises OnPropertyChanged for meta properties (IsXYZ) when PropertyChangedMode is not Windows.
virtual void CheckPropertyRules (IPropertyInfo property)
 Check rules for the property and notifies UI of properties that may have changed.
virtual void CheckObjectRules ()
 Check object rules and notifies UI of properties that may have changed.
void MarkClean ()
 Forces the object's IsDirty flag to false.
override void UndoChangesComplete ()
 Called when an undo operation has completed.
override void AcceptChangesComplete ()
 Notifies the parent object (if any) that this child object's edits have been accepted.
void MarkAsChild ()
 Marks the object as being a child object.
virtual object GetClone ()
 Creates a clone of the object.
virtual void OnValidationComplete ()
 Raises the ValidationComplete event.
BusinessRuleManager GetRegisteredRules ()
 Gets the registered rules. Only for unit testing and not visible to code.
virtual void AddBusinessRules ()
 Override this method in your business class to be notified when you need to set up shared business rules.
virtual void DataPortal_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.
virtual void DataPortal_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.
virtual void DataPortal_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access.
virtual void Child_Create ()
 Override this method to load a new business object with default values from the database.
virtual void Child_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.
virtual void Child_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.
virtual void Child_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access.
virtual string GetDataErrorInfoError ()
 Returns a string describing the error state of the object for use by IDataErrorInfo.Error. This method is called by the IDataErrorInfo.Error property implementation.
virtual IEnumerable GetNotifyDataErrorInfoGetErrors (string? propertyName)
 Gets the validation errors for a specified property or for the entire entity for use by INotifyDataErrorInfo.GetErrors(string?). This method is called by the INotifyDataErrorInfo.GetErrors(string?) method implementation.
virtual bool GetNotifyDataErrorInfoHasErrors ()
 Gets a value that indicates whether the entity has validation errors for use by INotifyDataErrorInfo.HasErrors. This method is called by the INotifyDataErrorInfo.HasErrors property implementation.
virtual string GetDataErrorInfoIndexerError (string columnName)
 Gets the error message for the property with the given name for use by IDataErrorInfo.this[string]. This method is called by the IDataErrorInfo.this[string] indexer implementation.
virtual void OnErrorsChanged (string? propertyName)
 Call to indicate that errors have changed for a property.
override void OnPropertyChanged (IPropertyInfo propertyInfo)
 Call this method to raise the PropertyChanged event for a specific property.
virtual void Deserialized ()
 Invoked after the object has been deserialized to allow derived classes to perform custom post-deserialization processing.
void AddEventHooks (IBusinessObject child)
 For internal use.
virtual void OnAddEventHooks (IBusinessObject child)
 Hook child object events.
void RemoveEventHooks (IBusinessObject child)
 For internal use only.
virtual void OnRemoveEventHooks (IBusinessObject child)
 Unhook child object events.
P? GetProperty< P > (string propertyName, P field, P? defaultValue)
 Gets a property's value, first checking authorization.
P? GetProperty< P > (string propertyName, P field, P? defaultValue, NoAccessBehavior noAccess)
 Gets a property's value, first checking authorization.
P? GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P field)
 Gets a property's value, first checking authorization.
P? GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P field, P? defaultValue, NoAccessBehavior noAccess)
 Gets a property's value, first checking authorization.
P? GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< F > propertyInfo, F field)
 Gets a property's value as a specified type, first checking authorization.
P? GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< F > propertyInfo, F field, NoAccessBehavior noAccess)
 Gets a property's value as a specified type, first checking authorization.
P? GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo)
 Gets a property's managed field value, first checking authorization.
P? GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< F > propertyInfo)
 Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.
P? GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< F > propertyInfo, NoAccessBehavior noAccess)
 Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.
P? GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, NoAccessBehavior noAccess)
 Gets a property's value as a specified type, first checking authorization.
object? GetProperty (IPropertyInfo propertyInfo)
 Gets a property's value as a specified type.
P? GetProperty< P > (IPropertyInfo propertyInfo)
 Gets a property's managed field value, first checking authorization.
P? LazyGetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > property, Func< P > valueGenerator)
 Lazily initializes a property and returns the resulting value.
bool PropertyIsLoading (IPropertyInfo propertyInfo)
 Gets a value indicating whether a lazy loaded property is currently being retrieved.
P? LazyGetPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > property, Task< P > factory)
 Lazily initializes a property and returns the resulting value.
P? ReadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< F > propertyInfo)
 Gets a property's value from the list of managed field values, converting the value to an appropriate type.
P? ReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo)
 Gets a property's value as a specified type.
virtual ? object ReadProperty (IPropertyInfo propertyInfo)
 Gets a property's value.
P? LazyReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > property, Func< P > valueGenerator)
 Gets a property's value as a specified type.
P? LazyReadPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > property, Task< P > factory)
 Gets a property's value as a specified type.
void SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, ref P? field, P? newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (string propertyName, ref P? field, P? newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > (PropertyInfo< P > propertyInfo, ref P? field, V? newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > (PropertyInfo< P > propertyInfo, ref P? field, V? newValue, NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (string propertyName, ref P? field, P? newValue, NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > (string propertyName, ref P? field, V? newValue, NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P? newValue)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > (PropertyInfo< P > propertyInfo, F? newValue)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > (PropertyInfo< P > propertyInfo, F? newValue, NoAccessBehavior noAccess)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P? newValue, NoAccessBehavior noAccess)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.
void SetProperty (IPropertyInfo propertyInfo, object? newValue)
 Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.
void SetProperty< P > (IPropertyInfo propertyInfo, P? newValue)
 Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.
void LoadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > (PropertyInfo< P > propertyInfo, F? newValue)
 Loads a property's managed field with the supplied value.
void LoadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P? newValue)
 Loads a property's managed field with the supplied value.
bool LoadPropertyMarkDirty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > (PropertyInfo< P > propertyInfo, P? newValue)
 Loads a property's managed field with the supplied value and mark field as dirty if value is modified.
virtual bool LoadPropertyMarkDirty (IPropertyInfo propertyInfo, object? newValue)
 Loads a property's managed field with the supplied value.
virtual void LoadProperty (IPropertyInfo propertyInfo, object? newValue)
 Loads a property's managed field with the supplied value.
void LoadPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] R > (PropertyInfo< R > property, Task< R > factory)
 Load a property from an async method.
void MarkBusy ()
 Mark the object as busy (it is running an async operation).
void MarkIdle ()
 Mark the object as not busy (it is not running an async operation).
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Raise the BusyChanged event.
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Raises the UnhandledAsyncException event.
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event.
virtual void OnChildChanged (ChildChangedEventArgs e)
 Raises the ChildChanged event, indicating that a child object has been changed.
virtual void EditChildComplete (IEditableBusinessObject child)
 Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has completed.
override void OnGetState (SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialization stream.
override void OnSetState (SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from the MobileFormatter serialization stream.
override void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to insert your child object references into the MobileFormatter serialization stream.
override void OnSetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to retrieve your child object references from the MobileFormatter serialization stream.
Protected Member Functions inherited from Csla.Core.UndoableBase
 UndoableBase ()
 Creates an instance of the type.
virtual void CopyingState ()
 This method is invoked before the CopyState operation begins.
virtual void CopyStateComplete ()
 This method is invoked after the CopyState operation is complete.
virtual void UndoingChanges ()
 This method is invoked after the UndoChanges operation is complete.
virtual void AcceptingChanges ()
 This method is invoked before the AcceptChanges operation begins.
override void OnGetState (SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialization stream.
override void OnSetState (SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from the MobileFormatter serialization stream.
override void OnGetMetastate (BinaryWriter writer)
 Override this method to write field values directly to a binary stream for metastate serialization.
Parameters
writerBinary writer for the output stream.

override void OnSetMetastate (BinaryReader reader)
 Override this method to read field values directly from a binary stream for metastate deserialization.
Parameters
readerBinary reader for the input stream.

Protected Member Functions inherited from Csla.Core.BindableBase
 BindableBase ()
 Creates an instance of the type.
virtual bool ShouldHandlerSerialize (PropertyChangedEventHandler value)
 Override this method to change the default logic for determining if the event handler should be serialized.
virtual void OnPropertyChanged (string propertyName)
 Call this method to raise the PropertyChanged event for a specific property.
virtual void OnMetaPropertyChanged (string propertyName)
virtual void OnIsDirtyChanged ()
 Call this method to raise the PropertyChanged event for all object properties.
virtual void OnUnknownPropertyChanged ()
 Call this method to raise the PropertyChanged event for all object properties.
virtual void OnIsDirtyChanging ()
 Call this method to raise the PropertyChanging event for all object properties.
virtual void OnUnknownPropertyChanging ()
 Call this method to raise the PropertyChanging event for all object properties.
virtual void OnPropertyChanging (string propertyName)
 Call this method to raise the PropertyChanging event for a specific property.
virtual void OnPropertyChanging (IPropertyInfo propertyInfo)
 Call this method to raise the PropertyChanging event for a specific property.
virtual bool ShouldHandlerSerialize (PropertyChangingEventHandler value)
 Override this method to change the default logic for determining if the event handler should be serialized.

Static Protected Member Functions

static IMemberInfo RegisterMethod (Type objectType, IMemberInfo info)
 Indicates that the specified method belongs to the type.
static MethodInfo RegisterMethod (Type objectType, string methodName)
 Indicates that the specified method belongs to the type.
static PropertyInfo< P > RegisterProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, PropertyInfo< P > info)
 Indicates that the specified property belongs to the type.

Properties

IParentParent [get]
 Provide access to the parent reference for use in child object code.
bool IsNew = true [get]
 Returns true if this is a new object, false if it is a pre-existing object.
bool IsDeleted [get]
 Returns true if this object is marked for deletion.
virtual bool IsDirty [get]
 Returns true if this object's data, or any of its fields or child objects data, has been changed.
virtual bool IsSelfDirty [get]
 Returns true if this object's data has been changed.
virtual bool IsSavable [get]
 Returns true if this object is both dirty and valid.
bool DisableIEditableObject [get, set]
 Gets or sets a value indicating whether the IEditableObject interface methods should be disabled for this object.
bool IsChild [get]
 Returns true if this is a child (non-root) object.
BusinessRules BusinessRules [get]
 Provides access to the broken rules functionality.
virtual bool IsValid [get]
 Returns true if the object and its child objects are currently valid, false if the object or any of its child objects have broken rules or are otherwise invalid.
virtual bool IsSelfValid [get]
 Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid.
virtual BrokenRulesCollection BrokenRulesCollection [get]
 Provides access to the readonly collection of broken business rules for this object.
virtual bool IsBusy [get]
 Gets a value indicating if this object or its child objects are busy.
virtual bool IsSelfBusy [get]
 Gets a value indicating if this object is busy.
FieldDataManager FieldManager [get]
 Gets the PropertyManager object for this business object.
Properties inherited from Csla.Core.UndoableBase
ApplicationContext ApplicationContext [get, set]
 Gets or sets a reference to the current ApplicationContext.
bool BindingEdit [get, set]
 Gets or sets a value indicating whether n-level undo was invoked through IEditableObject. FOR INTERNAL CSLA .NET USE ONLY!
int EditLevel [get]
 Returns the current edit level of the object.

Events

EventHandler? ValidationComplete [add, remove]
 Event raised when validation is complete.
BusyChangedEventHandlerBusyChanged [add, remove]
 Event indicating that the IsBusy property has changed.
EventHandler< ErrorEventArgs >? UnhandledAsyncException [add, remove]
 Event indicating that an exception occurred during the processing of an async operation.
EventHandler< ChildChangedEventArgs >? ChildChanged [add, remove]
 Event raised when a child object has been changed.
Events inherited from Csla.Core.BindableBase
PropertyChangedEventHandler? PropertyChanged [add, remove]
 Implements a serialization-safe PropertyChanged event.
PropertyChangingEventHandler? PropertyChanging [add, remove]
 Implements a serialization-safe PropertyChanging event.
Events inherited from Csla.Core.INotifyBusy
BusyChangedEventHandlerBusyChanged
 Event raised when the object's busy status changes.
Events inherited from Csla.Core.INotifyUnhandledAsyncException
EventHandler< ErrorEventArgs >? UnhandledAsyncException
 Event indicating that an exception occurred during an asynchronous operation.
Events inherited from Csla.Core.INotifyChildChanged
EventHandler< ChildChangedEventArgs >? ChildChanged
 Event indictating that a child object has changed.

Detailed Description

This is the non-generic base class from which most business objects will be derived.

Constructor & Destructor Documentation

◆ BusinessBase()

Csla.Core.BusinessBase.BusinessBase ( )
inlineprotected

Creates an instance of the type.

Member Function Documentation

◆ AcceptChangesComplete()

override void Csla.Core.BusinessBase.AcceptChangesComplete ( )
inlineprotectedvirtual

Notifies the parent object (if any) that this child object's edits have been accepted.

Reimplemented from Csla.Core.UndoableBase.

◆ AddBusinessRules()

virtual void Csla.Core.BusinessBase.AddBusinessRules ( )
inlineprotectedvirtual

Override this method in your business class to be notified when you need to set up shared business rules.

This method is automatically called by CSLA .NET when your object should associate per-type validation rules with its properties.

◆ AddEventHooks()

void Csla.Core.BusinessBase.AddEventHooks ( IBusinessObject child)
inlineprotected

For internal use.

Parameters
childChild object.

◆ ApplyEdit()

void Csla.Core.BusinessBase.ApplyEdit ( )
inline

Commits the current edit process.

Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last BeginEdit call.

Implements Csla.Core.ISupportUndo.

◆ BeginEdit()

void Csla.Core.BusinessBase.BeginEdit ( )
inline

Starts a nested edit on the object.

When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling CancelEdit or committed by calling ApplyEdit.

This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack.

See Chapters 2 and 3 for details on n-level undo and state stacking.

Implements Csla.Core.ISupportUndo.

◆ CancelEdit()

void Csla.Core.BusinessBase.CancelEdit ( )
inline

Cancels the current edit process, restoring the object's state to its previous values.

Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last BeginEdit call.

Implements Csla.Core.ISupportUndo.

◆ CanExecuteMethod() [1/3]

virtual bool Csla.Core.BusinessBase.CanExecuteMethod ( IMemberInfo method)
inlinevirtual

Returns true if the user is allowed to execute the specified method.

Parameters
methodMethod to execute.
Returns
true if execute is allowed.
Exceptions
ArgumentNullExceptionmethod is null.

◆ CanExecuteMethod() [2/3]

bool Csla.Core.BusinessBase.CanExecuteMethod ( IMemberInfo method,
bool throwOnFalse )
inline

Returns true if the user is allowed to execute the specified method.

Returns
true if execute is allowed.
Parameters
methodMethod to execute.
throwOnFalseIndicates whether a negative result should cause an exception.
Exceptions
ArgumentNullExceptionmethod is null.

◆ CanExecuteMethod() [3/3]

virtual bool Csla.Core.BusinessBase.CanExecuteMethod ( string methodName)
inlinevirtual

Returns true if the user is allowed to execute the specified method.

Parameters
methodNameName of the method to execute.
Returns
true if execute is allowed.

Implements Csla.Security.IAuthorizeReadWrite.

◆ CanReadProperty() [1/3]

virtual bool Csla.Core.BusinessBase.CanReadProperty ( IPropertyInfo property)
inlinevirtual

Returns true if the user is allowed to read the calling property.

Parameters
propertyProperty to check.
Exceptions
ArgumentNullExceptionproperty is null.

◆ CanReadProperty() [2/3]

bool Csla.Core.BusinessBase.CanReadProperty ( IPropertyInfo property,
bool throwOnFalse )
inline

Returns true if the user is allowed to read the calling property.

Returns
true if read is allowed.
Parameters
propertyProperty to read.
throwOnFalseIndicates whether a negative result should cause an exception.

◆ CanReadProperty() [3/3]

bool Csla.Core.BusinessBase.CanReadProperty ( string propertyName)
inline

Returns true if the user is allowed to read the specified property.

Parameters
propertyNameName of the property to read.
Exceptions
ArgumentNullExceptionpropertyName is null.

Implements Csla.Security.IAuthorizeReadWrite.

◆ CanWriteProperty() [1/3]

virtual bool Csla.Core.BusinessBase.CanWriteProperty ( IPropertyInfo property)
inlinevirtual

Returns true if the user is allowed to write the specified property.

Parameters
propertyProperty to write.
Exceptions
ArgumentNullExceptionproperty is null.

◆ CanWriteProperty() [2/3]

bool Csla.Core.BusinessBase.CanWriteProperty ( IPropertyInfo property,
bool throwOnFalse )
inline

Returns true if the user is allowed to write the calling property.

Returns
true if write is allowed.
Parameters
propertyProperty to write.
throwOnFalseIndicates whether a negative result should cause an exception.
Exceptions
ArgumentNullExceptionproperty is null.

◆ CanWriteProperty() [3/3]

bool Csla.Core.BusinessBase.CanWriteProperty ( string propertyName)
inline

Returns true if the user is allowed to write the specified property.

Parameters
propertyNameName of the property to write.
Exceptions
ArgumentNullExceptionpropertyName is null.

Implements Csla.Security.IAuthorizeReadWrite.

◆ CheckObjectRules()

virtual void Csla.Core.BusinessBase.CheckObjectRules ( )
inlineprotectedvirtual

Check object rules and notifies UI of properties that may have changed.

◆ CheckPropertyRules()

virtual void Csla.Core.BusinessBase.CheckPropertyRules ( IPropertyInfo property)
inlineprotectedvirtual

Check rules for the property and notifies UI of properties that may have changed.

Parameters
propertyThe property.

◆ Child_Create()

virtual void Csla.Core.BusinessBase.Child_Create ( )
inlineprotectedvirtual

Override this method to load a new business object with default values from the database.

Normally you will overload this method to accept a strongly-typed criteria parameter, rather than overriding the method with a loosely-typed criteria parameter.

◆ Child_OnDataPortalException()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalException ( DataPortalEventArgs e,
Exception ex )
inlineprotectedvirtual

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

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

◆ Child_OnDataPortalInvoke()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalInvoke ( DataPortalEventArgs e)
inlineprotectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

◆ Child_OnDataPortalInvokeComplete()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalInvokeComplete ( DataPortalEventArgs e)
inlineprotectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

◆ DataPortal_OnDataPortalException()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalException ( DataPortalEventArgs e,
Exception ex )
inlineprotectedvirtual

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

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

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalInvoke ( DataPortalEventArgs e)
inlineprotectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalInvokeComplete ( DataPortalEventArgs e)
inlineprotectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

◆ Delete()

virtual void Csla.Core.BusinessBase.Delete ( )
inlinevirtual

Marks the object for deletion. The object will be deleted as part of the next save operation.

CSLA .NET supports both immediate and deferred deletion of objects. This method is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This method is called by the UI developer to mark the object for deletion.

To 'undelete' an object, use n-level undo as discussed in Chapters 2 and 3.

Implements Csla.Core.IEditableBusinessObject.

◆ Deserialized()

virtual void Csla.Core.BusinessBase.Deserialized ( )
inlineprotectedvirtual

Invoked after the object has been deserialized to allow derived classes to perform custom post-deserialization processing.

Override this method in a derived class to implement actions that should occur immediately after deserialization, such as initializing transient fields or validating object state. This method is called automatically during the deserialization process.

Implements Csla.Serialization.Mobile.ISerializationNotification.

◆ EditChildComplete()

virtual void Csla.Core.BusinessBase.EditChildComplete ( IEditableBusinessObject child)
inlineprotectedvirtual

Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has completed.

Parameters
childThe child object that was edited.

◆ GetBrokenRules()

BrokenRulesCollection Csla.Core.BusinessBase.GetBrokenRules ( )
inline

Gets the broken rules for this object.

Implements Csla.Core.ICheckRules.

◆ GetClone()

virtual object Csla.Core.BusinessBase.GetClone ( )
inlineprotectedvirtual

Creates a clone of the object.

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

◆ GetDataErrorInfoError()

virtual string Csla.Core.BusinessBase.GetDataErrorInfoError ( )
inlineprotectedvirtual

Returns a string describing the error state of the object for use by IDataErrorInfo.Error. This method is called by the IDataErrorInfo.Error property implementation.

◆ GetDataErrorInfoIndexerError()

virtual string Csla.Core.BusinessBase.GetDataErrorInfoIndexerError ( string columnName)
inlineprotectedvirtual

Gets the error message for the property with the given name for use by IDataErrorInfo.this[string]. This method is called by the IDataErrorInfo.this[string] indexer implementation.

Parameters
columnNameThe name of the property whose error message to get.
Returns
The error message for the property. The default is an empty string ("").

◆ GetNotifyDataErrorInfoGetErrors()

virtual IEnumerable Csla.Core.BusinessBase.GetNotifyDataErrorInfoGetErrors ( string? propertyName)
inlineprotectedvirtual

Gets the validation errors for a specified property or for the entire entity for use by INotifyDataErrorInfo.GetErrors(string?). This method is called by the INotifyDataErrorInfo.GetErrors(string?) method implementation.

Parameters
propertyNameThe name of the property to retrieve validation errors for; or null or System.String.Empty, to retrieve entity-level errors.
Returns
The validation errors for the property or entity.

◆ GetNotifyDataErrorInfoHasErrors()

virtual bool Csla.Core.BusinessBase.GetNotifyDataErrorInfoHasErrors ( )
inlineprotectedvirtual

Gets a value that indicates whether the entity has validation errors for use by INotifyDataErrorInfo.HasErrors. This method is called by the INotifyDataErrorInfo.HasErrors property implementation.

Returns
true if the entity currently has validation errors; otherwise, false.

◆ GetProperty()

object? Csla.Core.BusinessBase.GetProperty ( IPropertyInfo propertyInfo)
inlineprotected

Gets a property's value as a specified type.

Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetProperty< P >() [1/3]

P? Csla.Core.BusinessBase.GetProperty< P > ( IPropertyInfo propertyInfo)
inlineprotected

Gets a property's managed field value, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetProperty< P >() [2/3]

P? Csla.Core.BusinessBase.GetProperty< P > ( string propertyName,
P field,
P? defaultValue )
inlineprotected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyNameThe name of the property.
defaultValueValue to be returned if the user is not authorized to read the property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyName is null.

◆ GetProperty< P >() [3/3]

P? Csla.Core.BusinessBase.GetProperty< P > ( string propertyName,
P field,
P? defaultValue,
NoAccessBehavior noAccess )
inlineprotected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyNameThe name of the property.
defaultValueValue to be returned if the user is not authorized to read the property.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.
Exceptions
ArgumentNullExceptionpropertyName is null.

◆ GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [1/4]

P? Csla.Core.BusinessBase.GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo)
inlineprotected

Gets a property's managed field value, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [2/4]

P? Csla.Core.BusinessBase.GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
NoAccessBehavior noAccess )
inlineprotected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [3/4]

P? Csla.Core.BusinessBase.GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P field )
inlineprotected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [4/4]

P? Csla.Core.BusinessBase.GetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P field,
P? defaultValue,
NoAccessBehavior noAccess )
inlineprotected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.
defaultValueValue to be returned if the user is not authorized to read the property.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.
Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [1/4]

P? Csla.Core.BusinessBase.GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< F > propertyInfo)
inlineprotected

Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [2/4]

P? Csla.Core.BusinessBase.GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< F > propertyInfo,
F field )
inlineprotected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
FType of the field.
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [3/4]

P? Csla.Core.BusinessBase.GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< F > propertyInfo,
F field,
NoAccessBehavior noAccess )
inlineprotected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
FType of the field.
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [4/4]

P? Csla.Core.BusinessBase.GetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< F > propertyInfo,
NoAccessBehavior noAccess )
inlineprotected

Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ GetRegisteredRules()

BusinessRuleManager Csla.Core.BusinessBase.GetRegisteredRules ( )
inlineprotected

Gets the registered rules. Only for unit testing and not visible to code.

◆ Initialize()

virtual void Csla.Core.BusinessBase.Initialize ( )
inlineprotectedvirtual

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

◆ IsPropertyBusy() [1/2]

virtual bool Csla.Core.BusinessBase.IsPropertyBusy ( IPropertyInfo property)
inlinevirtual

Gets a value indicating whether a specific property is busy (has a currently executing async rule).

Parameters
propertyProperty to check.
Exceptions
ArgumentNullExceptionproperty is null.

◆ IsPropertyBusy() [2/2]

bool Csla.Core.BusinessBase.IsPropertyBusy ( string propertyName)
inline

Gets a value indicating whether a specific property is busy (has a currently executing async rule).

Parameters
propertyNameName of the property.
Exceptions
ArgumentNullExceptionpropertyName is null.

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

P? Csla.Core.BusinessBase.LazyGetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > property,
Func< P > valueGenerator )
inlineprotected

Lazily initializes a property and returns the resulting value.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
valueGeneratorMethod returning the new value.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionproperty or valueGenerator is null.

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

P? Csla.Core.BusinessBase.LazyGetPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > property,
Task< P > factory )
inlineprotected

Lazily initializes a property and returns the resulting value.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
factoryAsync method returning the new value.

Note that the first value returned is almost certainly the defaultValue because the value is initialized asynchronously. The real value is provided later along with a PropertyChanged event to indicate the value has changed.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Exceptions
ArgumentNullExceptionproperty or factory is null.

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

P? Csla.Core.BusinessBase.LazyReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > property,
Func< P > valueGenerator )
inlineprotected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
valueGeneratorMethod returning the new value.
Exceptions
ArgumentNullExceptionproperty or valueGenerator is null.

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

P? Csla.Core.BusinessBase.LazyReadPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > property,
Task< P > factory )
inlineprotected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
factoryAsync method returning the new value.
Exceptions
ArgumentNullExceptionproperty or factory is null.

◆ LoadProperty()

virtual void Csla.Core.BusinessBase.LoadProperty ( IPropertyInfo propertyInfo,
object? newValue )
inlineprotectedvirtual

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

Parameters
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
ArgumentNullExceptionpropertyInfo is null.

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

void Csla.Core.BusinessBase.LoadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P? newValue )
inlineprotected

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

Template Parameters
PType of the property.
Parameters
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
ArgumentNullExceptionpropertyInfo is null.
PropertyLoadException

◆ LoadPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] R >()

void Csla.Core.BusinessBase.LoadPropertyAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] R > ( PropertyInfo< R > property,
Task< R > factory )
inlineprotected

Load a property from an async method.

Template Parameters
R
Parameters
property
factory
Exceptions
ArgumentNullExceptionproperty or factory is null.

◆ LoadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F >()

void Csla.Core.BusinessBase.LoadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > ( PropertyInfo< P > propertyInfo,
F? newValue )
inlineprotected

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

Parameters
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
ArgumentNullExceptionpropertyInfo is null.
PropertyLoadException

◆ LoadPropertyMarkDirty()

virtual bool Csla.Core.BusinessBase.LoadPropertyMarkDirty ( IPropertyInfo propertyInfo,
object? newValue )
inlineprotectedvirtual

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

Parameters
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
ArgumentNullExceptionpropertyInfo is null.

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

bool Csla.Core.BusinessBase.LoadPropertyMarkDirty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P? newValue )
inlineprotected

Loads a property's managed field with the supplied value and mark field as dirty if value is modified.

Template Parameters
PType of the property.
Parameters
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
ArgumentNullExceptionpropertyInfo is null.
PropertyLoadException

◆ MarkAsChild()

void Csla.Core.BusinessBase.MarkAsChild ( )
inlineprotected

Marks the object as being a child object.

◆ MarkBusy()

void Csla.Core.BusinessBase.MarkBusy ( )
inlineprotected

Mark the object as busy (it is running an async operation).

◆ MarkClean()

void Csla.Core.BusinessBase.MarkClean ( )
inlineprotected

Forces the object's IsDirty flag to false.

This method is normally called automatically and is not intended to be called manually.

◆ MarkDeleted()

void Csla.Core.BusinessBase.MarkDeleted ( )
inlineprotected

Marks an object for deletion. This also marks the object as being dirty.

You should call this method in your business logic in the case that you want to have the object deleted when it is saved to the database.

◆ MarkDirty() [1/2]

void Csla.Core.BusinessBase.MarkDirty ( )
inlineprotected

Marks an object as being dirty, or changed.

You should call this method in your business logic any time the object's internal data changes. Any time any instance variable changes within the object, this method should be called to tell CSLA .NET that the object's data has been changed.

Marking an object as dirty does two things. First it ensures that CSLA .NET will properly save the object as appropriate. Second, it causes CSLA .NET to tell Windows Forms data binding that the object's data has changed so any bound controls will update to reflect the new values.

◆ MarkDirty() [2/2]

void Csla.Core.BusinessBase.MarkDirty ( bool suppressEvent)
inlineprotected

Marks an object as being dirty, or changed.

Parameters
suppressEventtrue to suppress the PropertyChanged event that is otherwise raised to indicate that the object's state has changed.

◆ MarkIdle()

void Csla.Core.BusinessBase.MarkIdle ( )
inlineprotected

Mark the object as not busy (it is not running an async operation).

◆ MarkNew()

virtual void Csla.Core.BusinessBase.MarkNew ( )
inlineprotectedvirtual

Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion.

Newly created objects are marked new by default. You should call this method in the implementation of DataPortal_Update when the object is deleted (due to being marked for deletion) to indicate that the object no longer reflects data in the database.

If you override this method, make sure to call the base implementation after executing your new code.

◆ MarkOld()

virtual void Csla.Core.BusinessBase.MarkOld ( )
inlineprotectedvirtual

Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty).

You should call this method in the implementation of DataPortal_Fetch to indicate that an existing object has been successfully retrieved from the database.

You should call this method in the implementation of DataPortal_Update to indicate that a new object has been successfully inserted into the database.

If you override this method, make sure to call the base implementation after executing your new code.

◆ MetaPropertyHasChanged()

virtual void Csla.Core.BusinessBase.MetaPropertyHasChanged ( string name)
inlineprotectedvirtual

Raises OnPropertyChanged for meta properties (IsXYZ) when PropertyChangedMode is not Windows.

Parameters
namemeta property name that has cchanged.

◆ OnAddEventHooks()

virtual void Csla.Core.BusinessBase.OnAddEventHooks ( IBusinessObject child)
inlineprotectedvirtual

Hook child object events.

Parameters
childChild object.

◆ OnApplicationContextSet()

override void Csla.Core.BusinessBase.OnApplicationContextSet ( )
inlineprotectedvirtual

Method invoked after ApplicationContext is available.

Reimplemented from Csla.Core.UndoableBase.

◆ OnBusyChanged()

virtual void Csla.Core.BusinessBase.OnBusyChanged ( BusyChangedEventArgs args)
inlineprotectedvirtual

Raise the BusyChanged event.

Parameters
argsEvent args.

◆ OnChildChanged()

virtual void Csla.Core.BusinessBase.OnChildChanged ( ChildChangedEventArgs e)
inlineprotectedvirtual

Raises the ChildChanged event, indicating that a child object has been changed.

Parameters
eChildChangedEventArgs object.

◆ OnErrorsChanged()

virtual void Csla.Core.BusinessBase.OnErrorsChanged ( string? propertyName)
inlineprotectedvirtual

Call to indicate that errors have changed for a property.

Parameters
propertyNameName of the property.

◆ OnGetChildren()

override void Csla.Core.BusinessBase.OnGetChildren ( SerializationInfo info,
MobileFormatter formatter )
inlineprotectedvirtual

Override this method to insert your child object references into the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.
formatterReference to MobileFormatter instance. Use this to convert child references to/from reference id values.

Reimplemented from Csla.Core.MobileObject.

◆ OnGetMetastate()

override void Csla.Core.BusinessBase.OnGetMetastate ( System.IO.BinaryWriter writer)
inlineprotected

◆ OnGetState()

override void Csla.Core.BusinessBase.OnGetState ( SerializationInfo info,
StateMode mode )
inlineprotectedvirtual

Override this method to insert your field values into the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.
modeThe StateMode indicating why this method was invoked.

Reimplemented from Csla.Core.MobileObject.

◆ OnPropertyChanged()

override void Csla.Core.BusinessBase.OnPropertyChanged ( IPropertyInfo propertyInfo)
inlineprotectedvirtual

Call this method to raise the PropertyChanged event for a specific property.

Parameters
propertyInfoPropertyInfo of the property that has changed.

This method may be called by properties in the business class to indicate the change in a specific property.

Reimplemented from Csla.Core.BindableBase.

◆ OnRemoveEventHooks()

virtual void Csla.Core.BusinessBase.OnRemoveEventHooks ( IBusinessObject child)
inlineprotectedvirtual

Unhook child object events.

Parameters
childChild object.

◆ OnSetChildren()

override void Csla.Core.BusinessBase.OnSetChildren ( SerializationInfo info,
MobileFormatter formatter )
inlineprotectedvirtual

Override this method to retrieve your child object references from the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.
formatterReference to MobileFormatter instance. Use this to convert child references to/from reference id values.

Reimplemented from Csla.Core.MobileObject.

◆ OnSetMetastate()

override void Csla.Core.BusinessBase.OnSetMetastate ( System.IO.BinaryReader reader)
inlineprotected

◆ OnSetState()

override void Csla.Core.BusinessBase.OnSetState ( SerializationInfo info,
StateMode mode )
inlineprotectedvirtual

Override this method to retrieve your field values from the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.
modeThe StateMode indicating why this method was invoked.

Reimplemented from Csla.Core.MobileObject.

◆ OnUnhandledAsyncException() [1/2]

virtual void Csla.Core.BusinessBase.OnUnhandledAsyncException ( ErrorEventArgs error)
inlineprotectedvirtual

Raises the UnhandledAsyncException event.

Parameters
errorArgs parameter.

◆ OnUnhandledAsyncException() [2/2]

void Csla.Core.BusinessBase.OnUnhandledAsyncException ( object originalSender,
Exception error )
inlineprotected

Raises the UnhandledAsyncException event.

Parameters
originalSenderOriginal sender of the event.
errorException object.

◆ OnValidationComplete()

virtual void Csla.Core.BusinessBase.OnValidationComplete ( )
inlineprotectedvirtual

Raises the ValidationComplete event.

◆ PropertyHasChanged()

virtual void Csla.Core.BusinessBase.PropertyHasChanged ( IPropertyInfo property)
inlineprotectedvirtual

Performs processing required when a property has changed.

Parameters
propertyProperty that has changed.

This method calls CheckRules(propertyName), MarkDirty and OnPropertyChanged(propertyName). MarkDirty is called such that no event is raised for IsDirty, so only the specific property changed event for the current property is raised.

◆ PropertyIsLoading()

bool Csla.Core.BusinessBase.PropertyIsLoading ( IPropertyInfo propertyInfo)
inlineprotected

Gets a value indicating whether a lazy loaded property is currently being retrieved.

Parameters
propertyInfoProperty to check.
Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ ReadProperty()

virtual ? object Csla.Core.BusinessBase.ReadProperty ( IPropertyInfo propertyInfo)
inlineprotectedvirtual

Gets a property's value.

Parameters
propertyInfoPropertyInfo object containing property metadata.
Exceptions
ArgumentNullExceptionpropertyInfo is null.

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

P? Csla.Core.BusinessBase.ReadProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo)
inlineprotected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ ReadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >()

P? Csla.Core.BusinessBase.ReadPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< F > propertyInfo)
inlineprotected

Gets a property's value from the list of managed field values, converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ RegisterMethod() [1/2]

IMemberInfo Csla.Core.BusinessBase.RegisterMethod ( Type objectType,
IMemberInfo info )
inlinestaticprotected

Indicates that the specified method belongs to the type.

Parameters
objectTypeType of object to which the method belongs.
infoIMemberInfo object for the property.
Returns
The provided IMemberInfo object.
Exceptions
ArgumentNullExceptionobjectType or info is null.

◆ RegisterMethod() [2/2]

MethodInfo Csla.Core.BusinessBase.RegisterMethod ( Type objectType,
string methodName )
inlinestaticprotected

Indicates that the specified method belongs to the type.

Parameters
objectTypeType of object to which the method belongs.
methodNameName of the method.
Returns
The provided IMemberInfo object.
Exceptions
ArgumentNullExceptionobjectType or methodName is null.

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

PropertyInfo< P > Csla.Core.BusinessBase.RegisterProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType,
PropertyInfo< P > info )
inlinestaticprotected

Indicates that the specified property belongs to the type.

Template Parameters
PType of property.
Parameters
objectTypeType of object to which the property belongs.
infoPropertyInfo object for the property.
Returns
The provided IPropertyInfo object.
Exceptions
ArgumentNullExceptionobjectType or info is null.

◆ RemoveEventHooks()

void Csla.Core.BusinessBase.RemoveEventHooks ( IBusinessObject child)
inlineprotected

For internal use only.

Parameters
childChild object.

◆ SetParent()

virtual void Csla.Core.BusinessBase.SetParent ( IParent? parent)
inlineprotectedvirtual

Used by BusinessListBase as a child object is created to tell the child object about its parent.

Parameters
parentA reference to the parent collection object.

Implements Csla.Core.IEditableBusinessObject.

◆ SetProperty()

void Csla.Core.BusinessBase.SetProperty ( IPropertyInfo propertyInfo,
object? newValue )
inlineprotected

Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property a SecurityException is thrown.

Exceptions
ArgumentNullExceptionpropertyInfo is null.
SecurityException
PropertyLoadException

◆ SetProperty< P >()

void Csla.Core.BusinessBase.SetProperty< P > ( IPropertyInfo propertyInfo,
P? newValue )
inlineprotected

Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property a SecurityException is thrown.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [1/5]

void Csla.Core.BusinessBase.SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P? newValue )
inlineprotected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PProperty type.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [2/5]

void Csla.Core.BusinessBase.SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
P? newValue,
NoAccessBehavior noAccess )
inlineprotected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.
Exceptions
ArgumentNullExceptionpropertyInfo is null.
PropertyLoadException

◆ SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [3/5]

void Csla.Core.BusinessBase.SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( PropertyInfo< P > propertyInfo,
ref P? field,
P? newValue )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to change the property, this overload throws a SecurityException.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [4/5]

void Csla.Core.BusinessBase.SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( string propertyName,
ref P? field,
P? newValue )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Exceptions
ArgumentNullExceptionpropertyName is null.

◆ SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P >() [5/5]

void Csla.Core.BusinessBase.SetProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P > ( string propertyName,
ref P? field,
P? newValue,
NoAccessBehavior noAccess )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.
Exceptions
ArgumentNullExceptionpropertyName is null.

◆ SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F >() [1/2]

void Csla.Core.BusinessBase.SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > ( PropertyInfo< P > propertyInfo,
F? newValue )
inlineprotected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F >() [2/2]

void Csla.Core.BusinessBase.SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] F > ( PropertyInfo< P > propertyInfo,
F? newValue,
NoAccessBehavior noAccess )
inlineprotected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.
Exceptions
ArgumentNullExceptionpropertyInfo is null.
SecurityException
PropertyLoadException

◆ SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V >() [1/3]

void Csla.Core.BusinessBase.SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > ( PropertyInfo< P > propertyInfo,
ref P? field,
V? newValue )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to change the property, this overload throws a SecurityException.

Exceptions
ArgumentNullExceptionpropertyInfo is null.
SecurityException
PropertyLoadException

◆ SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V >() [2/3]

void Csla.Core.BusinessBase.SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > ( PropertyInfo< P > propertyInfo,
ref P? field,
V? newValue,
NoAccessBehavior noAccess )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

If the field value is of type string, any incoming null values are converted to string.Empty.

Exceptions
ArgumentNullExceptionpropertyInfo is null.

◆ SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V >() [3/3]

void Csla.Core.BusinessBase.SetPropertyConvert<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] P,[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] V > ( string propertyName,
ref P? field,
V? newValue,
NoAccessBehavior noAccess )
inlineprotected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

If the field value is of type string, any incoming null values are converted to string.Empty.

Exceptions
ArgumentNullExceptionpropertyName is null.
SecurityException
PropertyLoadException

◆ UndoChangesComplete()

override void Csla.Core.BusinessBase.UndoChangesComplete ( )
inlineprotectedvirtual

Called when an undo operation has completed.

This method resets the object as a result of deserialization and raises PropertyChanged events to notify data binding that the object has changed.

Reimplemented from Csla.Core.UndoableBase.

◆ WaitForIdle() [1/3]

async Task Csla.Core.BusinessBase.WaitForIdle ( )
inline

Await this method to ensure business object is not busy.

◆ WaitForIdle() [2/3]

virtual Task Csla.Core.BusinessBase.WaitForIdle ( CancellationToken ct)
inlinevirtual

Await this method to ensure the business object is not busy.

Parameters
ctCancellation token.

◆ WaitForIdle() [3/3]

Task Csla.Core.BusinessBase.WaitForIdle ( TimeSpan timeout)
inline

Await this method to ensure business object is not busy.

Parameters
timeoutTimeout duration

Property Documentation

◆ BrokenRulesCollection

virtual BrokenRulesCollection Csla.Core.BusinessBase.BrokenRulesCollection
get

Provides access to the readonly collection of broken business rules for this object.

◆ BusinessRules

BusinessRules Csla.Core.BusinessBase.BusinessRules
getprotected

Provides access to the broken rules functionality.

This property is used within your business logic so you can easily call the AddRule() method to associate business rules with your object's properties.

◆ DisableIEditableObject

bool Csla.Core.BusinessBase.DisableIEditableObject
getsetprotected

Gets or sets a value indicating whether the IEditableObject interface methods should be disabled for this object.

Defaults to False, indicating that the IEditableObject methods will behave normally.

If you disable the IEditableObject methods then Windows Forms data binding will no longer automatically call BeginEdit, CancelEdit or ApplyEdit on your object, and you will have to call these methods manually to get proper n-level undo behavior.

◆ FieldManager

FieldDataManager Csla.Core.BusinessBase.FieldManager
getprotected

Gets the PropertyManager object for this business object.

◆ IsBusy

virtual bool Csla.Core.BusinessBase.IsBusy
get

Gets a value indicating if this object or its child objects are busy.

Implements Csla.Core.INotifyBusy.

◆ IsChild

bool Csla.Core.BusinessBase.IsChild
get

Returns true if this is a child (non-root) object.

Implements Csla.Core.ITrackStatus.

◆ IsDeleted

bool Csla.Core.BusinessBase.IsDeleted
get

Returns true if this object is marked for deletion.

CSLA .NET supports both immediate and deferred deletion of objects. This property is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This property indicates whether or not the current object has been marked for deletion. If it is true , the object will be deleted when it is saved to the database, otherwise it will be inserted or updated by the save operation.

Returns
A value indicating if this object is marked for deletion.

Implements Csla.Core.ITrackStatus.

◆ IsDirty

virtual bool Csla.Core.BusinessBase.IsDirty
get

Returns true if this object's data, or any of its fields or child objects data, has been changed.

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

Returns
A value indicating if this object's data has been changed.

Implements Csla.Core.ITrackStatus.

◆ IsNew

bool Csla.Core.BusinessBase.IsNew = true
get

Returns true if this is a new object, false if it is a pre-existing object.

An object is considered to be new if its primary identifying (key) value doesn't correspond to data in the database. In other words, if the data values in this particular object have not yet been saved to the database the object is considered to be new. Likewise, if the object's data has been deleted from the database then the object is considered to be new.

Returns
A value indicating if this object is new.

Implements Csla.Core.ITrackStatus.

◆ IsSavable

virtual bool Csla.Core.BusinessBase.IsSavable
get

Returns true if this object is both dirty and valid.

An object is considered dirty (changed) if P:Csla.BusinessBase.IsDirty returns true. It is considered valid if IsValid returns true. The IsSavable property is a combination of these two properties.

Returns
A value indicating if this object is both dirty and valid.

Implements Csla.Core.ITrackStatus.

◆ IsSelfBusy

virtual bool Csla.Core.BusinessBase.IsSelfBusy
get

Gets a value indicating if this object is busy.

Implements Csla.Core.INotifyBusy.

◆ IsSelfDirty

virtual bool Csla.Core.BusinessBase.IsSelfDirty
get

Returns true if this object's data has been changed.

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

Returns
A value indicating if this object's data has been changed.

Implements Csla.Core.ITrackStatus.

◆ IsSelfValid

virtual bool Csla.Core.BusinessBase.IsSelfValid
get

Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid.

By default this property relies on the underling BusinessRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior.

Returns
A value indicating if the object is currently valid.

Implements Csla.Core.ITrackStatus.

◆ IsValid

virtual bool Csla.Core.BusinessBase.IsValid
get

Returns true if the object and its child objects are currently valid, false if the object or any of its child objects have broken rules or are otherwise invalid.

By default this property relies on the underling BusinessRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects.

Returns
A value indicating if the object is currently valid.

Implements Csla.Core.ITrackStatus.

◆ Parent

IParent? Csla.Core.BusinessBase.Parent
get

Provide access to the parent reference for use in child object code.

This value will be Nothing for root objects.

Implements Csla.Core.IParent.

Event Documentation

◆ BusyChanged

BusyChangedEventHandler? Csla.Core.BusinessBase.BusyChanged
addremove

Event indicating that the IsBusy property has changed.

◆ ChildChanged

EventHandler<ChildChangedEventArgs>? Csla.Core.BusinessBase.ChildChanged
addremove

Event raised when a child object has been changed.

◆ UnhandledAsyncException

EventHandler<ErrorEventArgs>? Csla.Core.BusinessBase.UnhandledAsyncException
addremove

Event indicating that an exception occurred during the processing of an async operation.

◆ ValidationComplete

EventHandler? Csla.Core.BusinessBase.ValidationComplete
addremove

Event raised when validation is complete.


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