Skip to content

UndeleteRequestHandler<TRow,TUndeleteRequest,TUndeleteResponse> class

namespace: Serenity.Services   assemblySerenity.Net.Services

Generic base class for undelete request handlers

public class UndeleteRequestHandler<TRow, TUndeleteRequest, TUndeleteResponse> : 
    IUndeleteHandler<TRow, TUndeleteRequest, TUndeleteResponse>, IUndeleteRequestProcessor
    where TRow : class, IRow, IIdRow, new()
    where TUndeleteRequest : UndeleteRequest
    where TUndeleteResponse : UndeleteResponse, new()
parameter description
TRow Entity type
TUndeleteRequest Undelete request type
TUndeleteResponse Undelete response type

Public Members

name description
UndeleteRequestHandler(…) Initializes a new instance of the class.
Cache { get; } Gets the two level cache from the request context.
Connection { get; } Gets the current connection from the unit of work.
Context { get; } Gets the request context.
Localizer { get; } Gets the localizer from the request context.
Permissions { get; } Gets the permission service from the request context.
Request { get; protected set; } Gets the request object.
Response { get; protected set; } Gets the response object.
Row { get; protected set; } Gets the entity being undeleted.
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 the current unit of work.
User { get; } Gets the current user from the request context.
Process(…) Processes the undelete request. This is the entry point for the handler.
Undelete(…)

Protected Members

name description
behaviors Lazy list of behaviors that is activated for this request.
virtual DoAudit() Performs auditing
virtual ExecuteUndelete() Executes the actual SQL undelete/update operation
virtual GetBehaviors() Gets the list of undelete 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 InvokeUndeleteAction(…) Invokes the passed undelete action method
virtual IsDeleted() Checks that row type implements one of IIsActiveDeletedRow, IIsDeletedRow or IDeleteLogRow interfaces and it is actual marked as deleted
virtual LoadEntity() Loads the entity that is going to be undeleted
virtual OnAfterUndelete() Method that is executed after the actual SQL undelete operation
virtual OnBeforeUndelete() Method that is executed before the actual SQL undelete 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 undelete operation
virtual ValidateRequest() Validates the parameters of the undelete request.

See Also