CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.BusinessListBase< T, C > Class Template Reference

This is the base class from which most business collections or lists will be derived. More...

Inheritance diagram for Csla.BusinessListBase< T, C >:
Csla.IBusinessListBase< C > Csla.Core.INotifyBusy Csla.Core.IParent Csla.Core.ISavable< T > Csla.Core.ISavable< T > Csla.Core.IUndoableObject Csla.Core.IEditableCollection Csla.Core.ObservableBindingList< C >

Public Member Functions

Clone ()
 Creates a clone of the object. More...
 
bool ContainsDeleted (C item)
 Returns true if the internal deleted list contains the specified child object. More...
 
void BeginEdit ()
 Starts a nested edit on the object. More...
 
void CancelEdit ()
 Cancels the current edit process, restoring the object's state to its previous values. More...
 
void ApplyEdit ()
 Commits the current edit process. More...
 
Save ()
 Saves the object to the database. More...
 
async Task< T > SaveAsync ()
 Saves the object to the database. More...
 
async Task SaveAndMergeAsync ()
 Saves the object to the database, merging any resulting updates into the existing object graph. More...
 
void BeginSave ()
 Starts an async operation to save the object to the database. More...
 
void BeginSave (object userState)
 Starts an async operation to save the object to the database. More...
 
void BeginSave (EventHandler< SavedEventArgs > handler)
 Starts an async operation to save the object to the database. More...
 
async void BeginSave (EventHandler< SavedEventArgs > handler, object userState)
 Starts an async operation to save the object to the database. More...
 
- Public Member Functions inherited from Csla.Core.ObservableBindingList< C >
AddNew ()
 Adds a new item to this collection. More...
 
void AddRange (System.Collections.Generic.IEnumerable< T > range)
 Add a range of items to the list. More...
 
virtual void OnAddedNew (T item)
 Raises the AddedNew event. More...
 
- Public Member Functions inherited from Csla.Core.IEditableCollection
void RemoveChild (Core.IEditableBusinessObject child)
 Removes the specified child from the parent collection. More...
 
void SetParent (IParent parent)
 Used by BusinessListBase as a child object is created to tell the child object about its parent. More...
 
- Public Member Functions inherited from Csla.Core.IParent
void RemoveChild (Core.IEditableBusinessObject child)
 This method is called by a child object when it wants to be removed from the collection. More...
 
- Public Member Functions inherited from Csla.Core.IObservableBindingList
object AddNew ()
 Creates and adds a new item to the collection. More...
 
- Public Member Functions inherited from Csla.Serialization.Mobile.ISerializationNotification
void Deserialized ()
 Method called on an object after deserialization is complete. More...
 
- Public Member Functions inherited from Csla.Serialization.Mobile.IMobileObject
void GetState (SerializationInfo info)
 Method called by MobileFormatter when an object should serialize its data. More...
 
void GetChildren (SerializationInfo info, MobileFormatter formatter)
 Method called by MobileFormatter when an object should serialize its child references. More...
 
void SetState (SerializationInfo info)
 Method called by MobileFormatter when an object should be deserialized. More...
 
void SetChildren (SerializationInfo info, MobileFormatter formatter)
 Method called by MobileFormatter when an object should deserialize its child references. More...
 

Protected Member Functions

 BusinessListBase ()
 Creates an instance of the object. More...
 
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. More...
 
virtual object GetClone ()
 Creates a clone of the object. More...
 
virtual void EditChildComplete (Core.IEditableBusinessObject child)
 Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has completed. More...
 
override C AddNewCore ()
 Override this method to create a new object that is added to the collection. More...
 
override void InsertItem (int index, C item)
 Sets the edit level of the child object as it is added. More...
 
override void RemoveItem (int index)
 Marks the child object for deletion and moves it to the collection of deleted objects. More...
 
override void SetItem (int index, C item)
 Replaces the item at the specified index with the specified item, first moving the original item to the deleted list. More...
 
override void ClearItems ()
 Clears the collection, moving all active items to the deleted list. More...
 
override void OnGetState (SerializationInfo info)
 Method called by MobileFormatter when an object should serialize its data. More...
 
override void OnSetState (SerializationInfo info)
 Method called by MobileFormatter when an object should be deserialized. More...
 
override void OnGetChildren (Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
 Method called by MobileFormatter when an object should serialize its child references. More...
 
override void OnSetChildren (Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
 Method called by MobileFormatter when an object should deserialize its child references. More...
 
void MarkAsChild ()
 Marks the object as being a child object. More...
 
override void OnDeserialized ()
 Reset parent references on deserialization. More...
 
virtual void Child_Create ()
 Initializes a new instance of the object with default values. More...
 
virtual void Child_Update (params object[] parameters)
 Saves all items in the list, automatically performing insert, update or delete operations as necessary. More...
 
virtual async Task< T > SaveAsync (object userState, bool isSync)
 Saves the object to the database. More...
 
virtual void DataPortal_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access. More...
 
virtual void Child_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method. More...
 
virtual void Child_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_XYZ method. More...
 
virtual void Child_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access. More...
 
virtual void OnSaved (T newObject, Exception e, object userState)
 Raises the Saved event, indicating that the object has been saved, and providing a reference to the new object instance. More...
 
virtual void SetParent (Core.IParent parent)
 Used by BusinessListBase as a child object is created to tell the child object about its parent. More...
 
- Protected Member Functions inherited from Csla.Core.ObservableBindingList< C >
void OnRemovingItem (T removedItem)
 Raise the RemovingItem event. More...
 
override void RemoveItem (int index)
 Remove the item at the specified index. More...
 
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Override this method to be notified when the IsBusy property has changed. More...
 
void OnBusyChanged (string propertyName, bool busy)
 Raises the BusyChanged event for a specific property. More...
 
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Method invoked when an unhandled async exception has occurred. More...
 
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event. More...
 
override void InsertItem (int index, T item)
 Invoked when an item is inserted into the list. More...
 
virtual void OnAddEventHooks (T item)
 Method invoked when events are hooked for a child object. More...
 
virtual void OnRemoveEventHooks (T item)
 Method invoked when events are unhooked for a child object. More...
 
virtual void OnChildChanged (ChildChangedEventArgs e)
 Raises the ChildChanged event, indicating that a child object has been changed. More...
 
virtual void Child_PropertyChanged (object sender, PropertyChangedEventArgs e)
 Handles any PropertyChanged event from a child object and echoes it up as a ChildChanged event. More...
 
override void OnCollectionChanged (NotifyCollectionChangedEventArgs e)
 Raises the CollectionChanged event. More...
 
override void OnGetState (SerializationInfo info)
 Override this method to get custom field values from the serialization stream. More...
 
override void OnSetState (SerializationInfo info)
 Override this method to set custom field values into the serialization stream. More...
 
override void SetLoadListMode (bool enabled)
 Sets the load list mode for the list More...
 

Properties

MobileList< C > DeletedList [get]
 A collection containing all child objects marked for deletion. More...
 
int EditLevel [get]
 Returns the current edit level of the object. More...
 
bool IsChild [get]
 Indicates whether this collection object is a child object. More...
 
bool IsDirty [get]
 Gets a value indicating whether this object's data has been changed. More...
 
virtual bool IsSelfValid [get]
 Gets a value indicating whether this object is currently in a valid state (has no broken validation rules). More...
 
virtual bool IsValid [get]
 Gets a value indicating whether this object is currently in a valid state (has no broken validation rules). More...
 
virtual bool IsSavable [get]
 Returns true if this object has changes, is valid, the user is authorized and the object is not busy. More...
 
override bool IsBusy [get]
 Gets the busy status for this object and its child objects. More...
 
EventHandler< Csla.Core.SavedEventArgsSaved
 Event raised when an object has been saved. More...
 
Core.IParent Parent [get]
 Provide access to the parent reference for use in child object code. More...
 
- Properties inherited from Csla.Core.ObservableBindingList< C >
virtual bool SupportsChangeNotificationCore [get]
 Gets a value indicating whether this object supports change notification. More...
 
bool AllowEdit [getprotected set]
 Gets or sets a value indicating whether data binding can automatically edit items in this collection. More...
 
bool AllowNew [getprotected set]
 Gets or sets a value indicating whether data binding can automatically add new items to this collection. More...
 
bool AllowRemove [getprotected set]
 Gets or sets a value indicating whether data binding can automatically remove items from this collection. More...
 
bool RaiseListChangedEvents [getset]
 Gets or sets a value indicating whether the collection should raise changed events. More...
 
EventHandler< RemovingItemEventArgsRemovingItem
 Implements a serialization-safe RemovingItem event. More...
 
BusyChangedEventHandler BusyChanged
 Event indicating that the busy status of the object has changed. More...
 
virtual bool IsBusy [get]
 Gets the busy status for this object and its child objects. More...
 
virtual bool IsSelfBusy [get]
 Gets the busy status for this object. More...
 
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during an async operation. More...
 
EventHandler< Csla.Core.ChildChangedEventArgsChildChanged
 Event raised when a child object has been changed. More...
 
EventHandler< AddedNewEventArgs< T > > AddedNew
 Event raised when a new object has been added to the collection. More...
 
IDisposable SuppressListChangedEvents [get]
 Use this object to suppress ListChangedEvents for an entire code block. More...
 
- Properties inherited from Csla.Core.IBusinessObject
int Identity [get]
 Gets a value representing this object instance's unique identity value within the business object graph. More...
 
- Properties inherited from Csla.Core.ITrackStatus
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. More...
 
bool IsSelfValid [get]
 Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid. More...
 
bool IsDirty [get]
 Returns true if this object's data, or any of its fields or child objects data, has been changed. More...
 
bool IsSelfDirty [get]
 Returns true if this object's data has been changed. More...
 
bool IsDeleted [get]
 Returns true if this object is marked for deletion. More...
 
bool IsNew [get]
 Returns true if this is a new object, false if it is a pre-existing object. More...
 
bool IsSavable [get]
 Returns true if this object is both dirty and valid. More...
 
bool IsChild [get]
 Returns true if this is a child object, false if it is a root object. More...
 
- Properties inherited from Csla.Core.INotifyBusy
bool IsBusy [get]
 Gets a value indicating whether the object, or any of the object's child objects, are busy running an asynchronous operation. More...
 
bool IsSelfBusy [get]
 Gets a value indicating whether the object is busy running an asynchronous operation. More...
 
- Properties inherited from Csla.Core.IUndoableObject
int EditLevel [get]
 Gets the current edit level of the object. More...
 
- Properties inherited from Csla.Core.IParent
IParent Parent [get]
 Provide access to the parent reference for use in child object code. More...
 

Additional Inherited Members

- Events inherited from Csla.Core.INotifyBusy
BusyChangedEventHandler BusyChanged
 Event raised when the object's busy status changes. More...
 
- Events inherited from Csla.Core.INotifyUnhandledAsyncException
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during an asynchronous operation. More...
 
- Events inherited from Csla.Core.ISavable< T >
EventHandler< SavedEventArgsSaved
 Event raised when an object has been saved. More...
 
- Events inherited from Csla.Core.IObservableBindingList
EventHandler< RemovingItemEventArgsRemovingItem
 Event indicating that an item is being removed from the list. More...
 
- Events inherited from Csla.Core.INotifyChildChanged
EventHandler< ChildChangedEventArgsChildChanged
 Event indictating that a child object has changed. More...
 

Detailed Description

This is the base class from which most business collections or lists will be derived.

Template Parameters
TType of the business object being defined.
CType of the child objects contained in the list.
Type Constraints
T :BusinessListBase 
T :T 
T :C 
C :Core.IEditableBusinessObject 

Definition at line 33 of file BusinessListBase.cs.

Constructor & Destructor Documentation

◆ BusinessListBase()

Csla.BusinessListBase< T, C >.BusinessListBase ( )
protected

Creates an instance of the object.

Definition at line 45 of file BusinessListBase.cs.

Member Function Documentation

◆ AddNewCore()

override C Csla.BusinessListBase< T, C >.AddNewCore ( )
protectedvirtual

Override this method to create a new object that is added to the collection.

Reimplemented from Csla.Core.ObservableBindingList< C >.

Definition at line 289 of file BusinessListBase.cs.

◆ ApplyEdit()

void Csla.BusinessListBase< T, C >.ApplyEdit ( )

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.

This method triggers an Core.BusinessBase.ApplyEdit in all child objects.

Implements Csla.Core.ISupportUndo.

Definition at line 250 of file BusinessListBase.cs.

◆ BeginEdit()

void Csla.BusinessListBase< T, C >.BeginEdit ( )

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.

This method triggers the copying of all child object states.

Implements Csla.Core.ISupportUndo.

Definition at line 208 of file BusinessListBase.cs.

◆ BeginSave() [1/4]

void Csla.BusinessListBase< T, C >.BeginSave ( )

Starts an async operation to save the object to the database.

Implements Csla.Core.ISavable< T >.

Definition at line 989 of file BusinessListBase.cs.

◆ BeginSave() [2/4]

void Csla.BusinessListBase< T, C >.BeginSave ( EventHandler< SavedEventArgs handler)

Starts an async operation to save the object to the database.

Parameters
handlerMethod called when the operation is complete.

Definition at line 1011 of file BusinessListBase.cs.

◆ BeginSave() [3/4]

async void Csla.BusinessListBase< T, C >.BeginSave ( EventHandler< SavedEventArgs handler,
object  userState 
)

Starts an async operation to save the object to the database.

Parameters
handlerMethod called when the operation is complete.
userStateUser state object.

Definition at line 1024 of file BusinessListBase.cs.

◆ BeginSave() [4/4]

void Csla.BusinessListBase< T, C >.BeginSave ( object  userState)

Starts an async operation to save the object to the database.

Parameters
userStateUser state object.

Implements Csla.Core.ISavable< T >.

Definition at line 999 of file BusinessListBase.cs.

◆ CancelEdit()

void Csla.BusinessListBase< T, C >.CancelEdit ( )

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.

This method triggers an undo in all child objects.

Implements Csla.Core.ISupportUndo.

Definition at line 229 of file BusinessListBase.cs.

◆ Child_Create()

virtual void Csla.BusinessListBase< T, C >.Child_Create ( )
protectedvirtual

Initializes a new instance of the object with default values.

Definition at line 856 of file BusinessListBase.cs.

◆ Child_OnDataPortalException()

virtual void Csla.BusinessListBase< T, C >.Child_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

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.

Definition at line 1100 of file BusinessListBase.cs.

◆ Child_OnDataPortalInvoke()

virtual void Csla.BusinessListBase< T, C >.Child_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1081 of file BusinessListBase.cs.

◆ Child_OnDataPortalInvokeComplete()

virtual void Csla.BusinessListBase< T, C >.Child_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1090 of file BusinessListBase.cs.

◆ Child_Update()

virtual void Csla.BusinessListBase< T, C >.Child_Update ( params object[]  parameters)
protectedvirtual

Saves all items in the list, automatically performing insert, update or delete operations as necessary.

Parameters
parametersOptional parameters passed to child update methods.

Definition at line 869 of file BusinessListBase.cs.

◆ ClearItems()

override void Csla.BusinessListBase< T, C >.ClearItems ( )
protected

Clears the collection, moving all active items to the deleted list.

Definition at line 409 of file BusinessListBase.cs.

◆ Clone()

T Csla.BusinessListBase< T, C >.Clone ( )

Creates a clone of the object.

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

Definition at line 119 of file BusinessListBase.cs.

◆ ContainsDeleted()

bool Csla.BusinessListBase< T, C >.ContainsDeleted ( item)

Returns true if the internal deleted list contains the specified child object.

Parameters
itemChild object to check.

Definition at line 179 of file BusinessListBase.cs.

◆ DataPortal_OnDataPortalException()

virtual void Csla.BusinessListBase< T, C >.DataPortal_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

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.

Definition at line 1072 of file BusinessListBase.cs.

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.BusinessListBase< T, C >.DataPortal_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1053 of file BusinessListBase.cs.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.BusinessListBase< T, C >.DataPortal_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

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

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1062 of file BusinessListBase.cs.

◆ EditChildComplete()

virtual void Csla.BusinessListBase< T, C >.EditChildComplete ( Core.IEditableBusinessObject  child)
protectedvirtual

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

Parameters
childThe child object that was edited.

Definition at line 274 of file BusinessListBase.cs.

◆ GetClone()

virtual object Csla.BusinessListBase< T, C >.GetClone ( )
protectedvirtual

Creates a clone of the object.

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

Definition at line 110 of file BusinessListBase.cs.

◆ Initialize()

virtual void Csla.BusinessListBase< T, C >.Initialize ( )
protectedvirtual

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

Definition at line 59 of file BusinessListBase.cs.

◆ InsertItem()

override void Csla.BusinessListBase< T, C >.InsertItem ( int  index,
item 
)
protected

Sets the edit level of the child object as it is added.

Parameters
indexIndex of the item to insert.
itemItem to insert.

Definition at line 326 of file BusinessListBase.cs.

◆ MarkAsChild()

void Csla.BusinessListBase< T, C >.MarkAsChild ( )
protected

Marks the object as being a child object.

By default all business objects are 'parent' objects. This means that they can be directly retrieved and updated into the database.

We often also need child objects. These are objects which are contained within other objects. For instance, a parent Invoice object will contain child LineItem objects.

To create a child object, the MarkAsChild method must be called as the object is created. Please see Chapter 7 for details on the use of the MarkAsChild method.

Definition at line 702 of file BusinessListBase.cs.

◆ OnDeserialized()

override void Csla.BusinessListBase< T, C >.OnDeserialized ( )
protectedvirtual

Reset parent references on deserialization.

Reimplemented from Csla.Core.ObservableBindingList< C >.

Definition at line 837 of file BusinessListBase.cs.

◆ OnGetChildren()

override void Csla.BusinessListBase< T, C >.OnGetChildren ( Csla.Serialization.Mobile.SerializationInfo  info,
Csla.Serialization.Mobile.MobileFormatter  formatter 
)
protected

Method called by MobileFormatter when an object should serialize its child references.

The data should be serialized into the SerializationInfo parameter.

Parameters
infoObject to contain the serialized data.
formatterReference to the formatter performing the serialization.

Definition at line 638 of file BusinessListBase.cs.

◆ OnGetState()

override void Csla.BusinessListBase< T, C >.OnGetState ( SerializationInfo  info)
protected

Method called by MobileFormatter when an object should serialize its data.

The data should be serialized into the SerializationInfo parameter.

Parameters
infoObject to contain the serialized data.

Definition at line 603 of file BusinessListBase.cs.

◆ OnSaved()

virtual void Csla.BusinessListBase< T, C >.OnSaved ( newObject,
Exception  e,
object  userState 
)
protectedvirtual

Raises the Saved event, indicating that the object has been saved, and providing a reference to the new object instance.

Parameters
newObjectThe new object instance.
eExecption that occurred during the operation.
userStateUser state object.

Definition at line 1195 of file BusinessListBase.cs.

◆ OnSetChildren()

override void Csla.BusinessListBase< T, C >.OnSetChildren ( Csla.Serialization.Mobile.SerializationInfo  info,
Csla.Serialization.Mobile.MobileFormatter  formatter 
)
protected

Method called by MobileFormatter when an object should deserialize its child references.

The data should be deserialized from the SerializationInfo parameter.

Parameters
infoObject containing the serialized data.
formatterReference to the formatter performing the deserialization.

Definition at line 659 of file BusinessListBase.cs.

◆ OnSetState()

override void Csla.BusinessListBase< T, C >.OnSetState ( SerializationInfo  info)
protected

Method called by MobileFormatter when an object should be deserialized.

The data should be deserialized from the SerializationInfo parameter.

Parameters
infoObject containing the serialized data.

Definition at line 619 of file BusinessListBase.cs.

◆ RemoveItem()

override void Csla.BusinessListBase< T, C >.RemoveItem ( int  index)
protected

Marks the child object for deletion and moves it to the collection of deleted objects.

Parameters
indexIndex of the item to remove.

Definition at line 352 of file BusinessListBase.cs.

◆ Save()

T Csla.BusinessListBase< T, C >.Save ( )

Saves the object to the database.

Calling this method starts the save operation, causing the all child objects to be inserted, updated or deleted within the database based on the each object's current state.

All this is contingent on IsDirty. If this value is false, no data operation occurs. It is also contingent on IsValid. If this value is false an exception will be thrown to indicate that the UI attempted to save an invalid object.

It is important to note that this method returns a new version of the business collection that contains any data updated during the save operation. You MUST update all object references to use this new version of the business collection in order to have access to the correct object data.

You can override this method to add your own custom behaviors to the save operation. For instance, you may add some security checks to make sure the user can save the object. If all security checks pass, you would then invoke the base Save method via MyBase.Save().

Returns
A new object containing the saved values.

Implements Csla.Core.ISavable< T >.

Definition at line 913 of file BusinessListBase.cs.

◆ SaveAndMergeAsync()

async Task Csla.BusinessListBase< T, C >.SaveAndMergeAsync ( )

Saves the object to the database, merging any resulting updates into the existing object graph.

Implements Csla.Core.ISavable< T >.

Definition at line 980 of file BusinessListBase.cs.

◆ SaveAsync() [1/2]

async Task< T > Csla.BusinessListBase< T, C >.SaveAsync ( )

Saves the object to the database.

Implements Csla.Core.ISavable< T >.

Definition at line 931 of file BusinessListBase.cs.

◆ SaveAsync() [2/2]

virtual async Task< T > Csla.BusinessListBase< T, C >.SaveAsync ( object  userState,
bool  isSync 
)
protectedvirtual

Saves the object to the database.

Parameters
userStateUser state data.
isSyncTrue if the save operation should be synchronous.

Definition at line 941 of file BusinessListBase.cs.

◆ SetItem()

override void Csla.BusinessListBase< T, C >.SetItem ( int  index,
item 
)
protected

Replaces the item at the specified index with the specified item, first moving the original item to the deleted list.

Parameters
indexThe zero-based index of the item to replace.
itemThe new value for the item at the specified index. The value can be null for reference types.

Definition at line 382 of file BusinessListBase.cs.

◆ SetParent()

virtual void Csla.BusinessListBase< T, C >.SetParent ( Core.IParent  parent)
protectedvirtual

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.

Definition at line 1233 of file BusinessListBase.cs.

Property Documentation

◆ DeletedList

MobileList<C> Csla.BusinessListBase< T, C >.DeletedList
getprotected

A collection containing all child objects marked for deletion.

Definition at line 137 of file BusinessListBase.cs.

◆ EditLevel

int Csla.BusinessListBase< T, C >.EditLevel
getprotected

Returns the current edit level of the object.

Definition at line 430 of file BusinessListBase.cs.

◆ IsBusy

override bool Csla.BusinessListBase< T, C >.IsBusy
get

Gets the busy status for this object and its child objects.

Definition at line 790 of file BusinessListBase.cs.

◆ IsChild

bool Csla.BusinessListBase< T, C >.IsChild
get

Indicates whether this collection object is a child object.

Returns
True if this is a child object.

Definition at line 680 of file BusinessListBase.cs.

◆ IsDirty

bool Csla.BusinessListBase< T, C >.IsDirty
get

Gets a value indicating whether this object's data has been changed.

Definition at line 723 of file BusinessListBase.cs.

◆ IsSavable

virtual bool Csla.BusinessListBase< T, C >.IsSavable
get

Returns true if this object has changes, is valid, the user is authorized and the object is not busy.

Definition at line 778 of file BusinessListBase.cs.

◆ IsSelfValid

virtual bool Csla.BusinessListBase< T, C >.IsSelfValid
getprotected

Gets a value indicating whether this object is currently in a valid state (has no broken validation rules).

Definition at line 751 of file BusinessListBase.cs.

◆ IsValid

virtual bool Csla.BusinessListBase< T, C >.IsValid
get

Gets a value indicating whether this object is currently in a valid state (has no broken validation rules).

Definition at line 760 of file BusinessListBase.cs.

◆ Parent

Core.IParent Csla.BusinessListBase< T, C >.Parent
get

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

This value will be Nothing for root objects.

Definition at line 1219 of file BusinessListBase.cs.

◆ Saved

EventHandler<Csla.Core.SavedEventArgs> Csla.BusinessListBase< T, C >.Saved
addremove

Event raised when an object has been saved.

Definition at line 1172 of file BusinessListBase.cs.