Class EntityBase
Summary description for EntityBase.
Assembly: SoDataBase.dll
Syntax
public abstract class EntityBase : NestedPersist, INestedPersist, ISoItem, ITableRowLoadHandler
Constructors
EntityBase()
Declaration
Fields
Declaration
protected GetRelatedObjects _onGetRelatedObjects
Field Value
Properties
IsDirty
Check if any of the related objects are dirty.
Declaration
public override bool IsDirty { get; }
Property Value
Overrides
IsNew
Is the row new, e.g. not been inserted to the database?
Declaration
public abstract bool IsNew { get; }
Property Value
MainRow
Get the main row for the entity.
Declaration
protected abstract TableRowBase MainRow { get; }
Property Value
Methods
Delete()
Declaration
public abstract void Delete()
ForceEntityUpdate()
This method is called when only related objects are changed in order for the
entity to force the Updated and UpdatedAssociate to be modified on the entity.
Declaration
protected abstract void ForceEntityUpdate()
Hand-implemented partial class code should override this method to add to the list of related nestedpersist objects
Declaration
protected virtual void GetAdditionalRelatedNestedPersist(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Declaration
protected void GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Generated code should override this method to return its list of related nestedpersist objects
Declaration
protected abstract void GetRelatedNestedPersist(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type |
Name |
Description |
List<INestedPersist> |
relatedObjects |
|
Boolean |
lacyFetchIfNeeded |
Lacy fetch objects that is not allready loaded if needed
|
OnIdUpdate()
Declaration
protected override void OnIdUpdate()
Overrides
OnIdUpdateImplementation()
Declaration
protected virtual void OnIdUpdateImplementation()
OnPreIdUpdate()
Declaration
protected override void OnPreIdUpdate()
Overrides
OnPreIdUpdateImplementation()
Declaration
protected virtual void OnPreIdUpdateImplementation()
OnPrimaryKeyRequest(PKContainer)
Declaration
protected override void OnPrimaryKeyRequest(PKContainer pkContainer)
Parameters
Overrides
OnPrimaryKeyUpdate(PKContainer)
Declaration
protected override void OnPrimaryKeyUpdate(PKContainer pkContainer)
Parameters
Overrides
OnRowLoad(SoDataReader, TableRowBase)
Declaration
protected abstract void OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
OnRowLoaded()
Declaration
protected abstract void OnRowLoaded()
OnSave(BatchSave)
Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Overrides
OnSaved(Boolean)
Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type |
Name |
Description |
Boolean |
bSucceeded |
|
Overrides
Call this method to set the marked for delete on related objects.
Implement this method in implementation of enteties to set marked for delete on related objects
Declaration
protected virtual void SetMarkedForDeleteOnRelatedObjects(bool isMarkedForDelete)
Parameters
Type |
Name |
Description |
Boolean |
isMarkedForDelete |
True if the objects are to be removed from the database the next time it is saved.
|
UpdateSentryRelatedTableInfoInstance<MainTableInfoType>(SentryCollection, TableInfo)
Update a TableInfo object in all sentries in the entity, with a new instance of the same
kind of table
Declaration
protected void UpdateSentryRelatedTableInfoInstance<MainTableInfoType>(SentryCollection sentries, TableInfo newInstance)
where MainTableInfoType : TableInfo
Parameters
Type Parameters
Name |
Description |
MainTableInfoType |
|
Validate()
Check the entity and related objects for consistency and required fields, and return fields and error messages.
Declaration
public abstract Dictionary<string, string> Validate()
Returns
Events
Event raised when related objects are being collected for saving.
Declaration
public event GetRelatedObjects OnGetRelatedObjects
Event Type
Explicit Interface Implementations
ITableRowLoadHandler.OnRowLoad(SoDataReader, TableRowBase)
Declaration
void ITableRowLoadHandler.OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
ITableRowLoadHandler.OnRowLoaded()
Declaration
void ITableRowLoadHandler.OnRowLoaded()
Implements
Extension Methods
EnumUtil.MapEnums<From, To>(From)