Show / Hide Table of Contents

Class ActivityLinksHelper

Helper class for links to activite

Inheritance
object
NestedPersist
NestedPersistFacade
EntityDetailsHelper<TableRowBase, RelationsRow>
LinksHelper
ActivityLinksHelper
Implements
INestedPersist
Inherited Members
LinksHelper.AddSimilarLinkAsync(RelationsRow, CancellationToken)
LinksHelper.DeleteSimilarLinkAsync(RelationsRow, CancellationToken)
LinksHelper.EditSimilarLinkAsync(RelationsRow, CancellationToken)
LinksHelper.GetLinks()
LinksHelper.CopyToAsync(LinksHelper, CancellationToken)
LinksHelper.LoadChildItemsAsync(TableRowBase, CancellationToken)
LinksHelper.IsDeleted
EntityDetailsHelper<TableRowBase, RelationsRow>.LoadChildItemsAsync(TableRowBase, CancellationToken)
EntityDetailsHelper<TableRowBase, RelationsRow>.IsDirty
EntityDetailsHelper<TableRowBase, RelationsRow>.OnEntityDetailsHelperAdded
EntityDetailsHelper<TableRowBase, RelationsRow>.OnEntityDetailsHelperRemoved
EntityDetailsHelper<TableRowBase, RelationsRow>.OnEntityDetailsHelperEdited
NestedPersistFacade.IsDirty
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.SaveAsync()
NestedPersist.IsSaving
NestedPersist.IsMarkedForDelete
NestedPersist.OnElementSaved
NestedPersist.OnElementIdUpdate
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
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
LinksHelper.AddLinksAsync(RelationsRows, CancellationToken)

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
LinksHelper.DeleteLinks(params int[])

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
EntityDetailsHelper<TableRowBase, RelationsRow>.GetFacadingItems()

OnPreIdUpdateAsync()

Allow for "fake id's" to be forced upon related objects.

Declaration
protected override Task OnPreIdUpdateAsync()
Returns
Type Description
Task
Overrides
EntityDetailsHelper<TableRowBase, RelationsRow>.OnPreIdUpdateAsync()
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
NestedPersistFacade.OnPrimaryKeyRequestAsync(PKContainer)

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
EntityDetailsHelper<TableRowBase, RelationsRow>.OnSavedAsync(bool)

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

Overrides
LinksHelper.SetLinksAsync(RelationsRows, CancellationToken)

Implements

INestedPersist

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top