DeleteRequestHandler<TRow,TDeleteRequest,TDeleteResponse> class

namespace: Serenity.Services   assemblySerenity.Net.Services

Generic base class for delete request handlers

public class DeleteRequestHandler<TRow, TDeleteRequest, TDeleteResponse> : 
    IDeleteHandler<TRow, TDeleteRequest, TDeleteResponse>, IDeleteRequestProcessor
    where TRow : class, IRow, IIdRow, new()
    where TDeleteRequest : DeleteRequest
    where TDeleteResponse : DeleteResponse, new()
parameter description
TRow Entity type
TDeleteRequest Delete request type
TDeleteResponse Delete response type

Public Members

name description
DeleteRequestHandler(…) Creates an instance of the class
Cache { get; } Gets the two level cache from the request context
Connection { get; } Gets current connection from the unit of work
Context { get; } Gets the request context
Localizer { get; } Gets localizer from the request context
Permissions { get; } Gets permission service from the request context
Request { get; protected set; } Request object
Response { get; protected set; } Response object
Row { get; protected set; } The entity
StateBag { get; } A state bag for behaviors to preserve state among their methods. It will be cleared before each request, e.g. Process call.
UnitOfWork { get; protected set; } Gets current unit of work
User { get; } Gets current user from the request context
Process(…) Processes the delete request. This is the entry point for the handler.

Protected Members

name description
behaviors- Lazy list of behaviors that is activated for this request
virtual DoAudit() Performs auditing
virtual ExecuteDelete() Executes the actual SQL delete operation
virtual GetBehaviors() Gets the list of delete behaviors
virtual GetDisplayOrderFilter() Gets the display order filter for current group, if the entity implements IDisplayOrderRow interface
virtual InvalidateCacheOnCommit() Attaches a cache invalidation call to to OnCommit callback of the current unit of work. This would clear cached items related to this row type.
virtual InvokeDeleteAction(…) Invokes the passed delete action method
virtual IsDeleted() Checks if the entity is already deleted
virtual LoadEntity() Loads the entity that is going to be deleted
virtual OnAfterDelete() Method that is executed after the actual SQL delete operation
virtual OnBeforeDelete() Method that is executed before the actual SQL delete operation.
virtual OnReturn() The method that is called just before the response is returned.
virtual PrepareQuery(…) Prepares the query used to select the existing record
virtual ValidatePermissions() Validates the user permissions for delete operation
virtual ValidateRequest() Validates the parameters of the delete request.

See Also