LinkingSetRelationBehavior class
namespace: Serenity.Services assembly: Serenity.Net.Services
Behavior class that handles LinkingSetRelationAttribute.
public class LinkingSetRelationBehavior : BaseSaveDeleteBehaviorAsync, IDeleteBehaviorSync,
IFieldBehavior, IImplicitBehavior, IListBehaviorAsync, IListBehaviorSync,
IRetrieveBehaviorAsync, IRetrieveBehaviorSync, ISaveBehaviorSync
| parameter | description |
|---|---|
| handlerFactory | Default handler factory |
Public Members
| name | description |
|---|---|
| LinkingSetRelationBehavior(…) | Behavior class that handles LinkingSetRelationAttribute. |
| Target { get; set; } | |
| ActivateFor(…) | |
| virtual OnAfterSave(…) | |
| override OnAfterSaveAsync(…) | |
| virtual OnBeforeDelete(…) | |
| override OnBeforeDeleteAsync(…) | |
| virtual OnPrepareQuery(…) | |
| virtual OnPrepareQueryAsync(…) | |
| virtual OnReturn(…) | (2 methods) |
| virtual OnReturnAsync(…) | (2 methods) |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | handlerFactory is null. |
Remarks
Initializes a new instance of the class.
Saving or deleting the linking set invokes the nested save/delete handler once per item (an N+1 pattern). This is intentional, so the full handler pipeline (behaviors, audit, concurrency version checks, unique constraints, cascades and cache invalidation) applies to every link row. Batching these into a single statement would bypass that pipeline and change the semantics, so it is not done. Callers with very large item sets should be aware of the resulting number of round trips.
See Also
- class BaseSaveDeleteBehaviorAsync
- interface IDeleteBehaviorSync
- interface IFieldBehavior
- interface IImplicitBehavior
- interface IListBehaviorAsync
- interface IListBehaviorSync
- interface IRetrieveBehaviorAsync
- interface IRetrieveBehaviorSync
- interface ISaveBehaviorSync
- Source: LinkingSetRelationBehavior.cs