Skip to content

UniqueConstraintSaveBehavior class

namespace: Serenity.Services   assembly: Serenity.Net.Services

Behavior that handles UniqueConstraintAttribute on a row. It checks each unique constraint before save (unless CheckBeforeSave is disabled) by running an existence query. Override BuildUniqueConstraintQuery in a derived behavior, or add your own behavior and set DisableDefaultBehavior, to customize or replace the pre-check.

public class UniqueConstraintSaveBehavior : BaseUniqueConstraintSaveBehavior, IImplicitBehavior
parameter description
localizer Text localizer

Public Members

name description
UniqueConstraintSaveBehavior(…) Behavior that handles UniqueConstraintAttribute on a row. It checks each unique constraint before save (unless CheckBeforeSave is disabled) by running an existence query. Override BuildUniqueConstraintQuery in a derived behavior, or add your own behavior and set DisableDefaultBehavior, to customize or replace the pre-check.
ActivateFor(…)
virtual OnBeforeSave(…)
override OnBeforeSaveAsync(…)

Remarks

Initializes a new instance of the class.

See Also