Class ActivityLinksHelper
Helper class for links to activite
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public sealed class ActivityLinksHelper : LinksHelper, INestedPersist
Methods
AddAppointmentLinkAsync(AppointmentRow, CancellationToken)
Adds a link to an existing appointment
Declaration
public Task<RelationsRow> AddAppointmentLinkAsync(AppointmentRow row, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppointmentRow | row | The appointment that is linked to |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RelationsRow> | The new link |
AddDocumentLinkAsync(DocumentRow, CancellationToken)
Adds a link to an existing document
Declaration
public Task<RelationsRow> AddDocumentLinkAsync(DocumentRow row, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentRow | row | The document that is linked to |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RelationsRow> | The new link |
AddLinksAsync(RelationsRows, CancellationToken)
Adds link relations to the entity. If the source does not match the LinkHelper source an exception is thrown.
Declaration
public override Task<RelationsRows> AddLinksAsync(RelationsRows relationsRows, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RelationsRows | relationsRows | Collection Relations Rows to save |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RelationsRows> | The saved RelationsRows |
Overrides
AddSaleLinkAsync(SaleRow, CancellationToken)
Adds a link to an existing sale
Declaration
public Task<RelationsRow> AddSaleLinkAsync(SaleRow row, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleRow | row | The sale that is linked to |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RelationsRow> | The new link |
CreateAsync(TableRowBase, TableRowBase, CancellationToken)
Helper class for links to activite
Declaration
public static Task<ActivityLinksHelper> CreateAsync(TableRowBase sourceEntityRow, TableRowBase activeLinksRow, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TableRowBase | sourceEntityRow | |
| TableRowBase | activeLinksRow | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ActivityLinksHelper> |
DeleteLinks(params int[])
Deletes the links if the link belongs to the source entity
Declaration
public override void DeleteLinks(params int[] linkIds)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | linkIds |
Overrides
GetFacadingItems()
Implement this method to expose items that needs to be persisted.
Declaration
protected override IEnumerable<INestedPersist> GetFacadingItems()
Returns
| Type | Description |
|---|---|
| IEnumerable<INestedPersist> | Collection of items that needs to be persisted. |
Overrides
OnPreIdUpdateAsync()
Allow for "fake id's" to be forced upon related objects.
Declaration
protected override Task OnPreIdUpdateAsync()
Returns
| Type | Description |
|---|---|
| Task |
Overrides
Remarks
In order to figure out which objects taking part of the nested save operation that actually needs to be saved, this method allows for "fake id's" to be forced upon related objects. Upon receiving the "fake id", the objects receiving such an id can determine if they needs to be persisted (e.g. saved) to the database. However, the fake id's forced upon related objects must be set to correct id's in the OnIdUpdate method taking place later in the save operation.
OnPrimaryKeyRequestAsync(PKContainer)
Force a primary key request to set the sqltype of the target row, even if it is not actually a full member of our nestedpersist tree
Declaration
protected override Task OnPrimaryKeyRequestAsync(PKContainer pkContainer)
Parameters
| Type | Name | Description |
|---|---|---|
| PKContainer | pkContainer |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
OnSavedAsync(bool)
Called after the save operation has completed. A boolean value is passed to notify whether or not the save operation succeeded. The complete save operation is rolled back if Save operation failed.
Declaration
protected override Task OnSavedAsync(bool bSucceeded)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | bSucceeded | True if the save operation succeeded and false if the save operation failed and rolled back. |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
SetLinksAsync(RelationsRows, CancellationToken)
Sets link relations to the entity. Existing relations are deleted or updated If the source does not match the LinkHelper source an exception is thrown.
Declaration
public override Task SetLinksAsync(RelationsRows relationsRows, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RelationsRows | relationsRows | Collection of Relation Rows to save |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | The saved RelationsRows |