Skip to content

RetrieveRequestHandler<TRow,TRetrieveRequest,TRetrieveResponse> class

namespace: Serenity.Services   assemblySerenity.Net.Services

Generic base class for retrieve request handlers

public class RetrieveRequestHandler<TRow, TRetrieveRequest, TRetrieveResponse> : 
    IRetrieveHandler<TRow, TRetrieveRequest, TRetrieveResponse>, IRetrieveRequestProcessor
    where TRow : class, IRow, new()
    where TRetrieveRequest : RetrieveRequest
    where TRetrieveResponse : RetrieveResponse<TRow>, new()
parameter description
TRow Entity type
TRetrieveRequest Retrieve request type
TRetrieveResponse Retrieve response type

Public Members

name description
RetrieveRequestHandler(…) Initializes a new instance of the class.
Cache { get; } Gets the two level cache from the request context.
Connection { get; } Gets the current connection.
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.
Query { get; } Gets the select query.
Request { get; protected set; } Gets the request object.
Response { get; protected set; } Gets the response object.
Row { get; protected set; } Gets the entity used for querying / metadata lookup.
StateBag { get; } A state bag for behaviors to preserve state among their methods. It will be cleared before each request, e.g. Process call.
User { get; } Gets the current user from the request context.
Process(…) Processes the retrieve request. This is the entry point for the handler.
Retrieve(…)

Protected Members

name description
behaviors Lazy list of behaviors that is activated for this request.
virtual AllowSelectField(…) Returns true if the field should be allowed to be selected, based on its read permission and the SelectLevel.Never flag.
virtual CreateQuery() Creates a query instance with the dialect for current connection.
virtual ExecuteQuery() Executes the query and sets the response entity if found.
virtual GetBehaviors() Gets the list of retrieve behaviors.
IsIncluded(…) Returns true if field is included in IncludeColumns (2 methods)
virtual OnAfterExecuteQuery() Called after executing the retrieve query
virtual OnBeforeExecuteQuery() Called before executing the retrieve query
virtual OnReturn() Called just before returning the response
virtual PrepareQuery(…) Prepares query by calling SelectFields.
virtual SelectField(…) Calls query.Select(field)
virtual SelectFields(…) Calls query.Select(field) for all the fields without NotMapped, and if AllowSelectField and ShouldSelectField returns true.
virtual ShouldSelectField(…) Returns true if the field should be selected, based on current ColumnSelection, field MinSelectLevelAttribute, the field being a not mapped (NotMappedAttribute) field, table field, or a view / expression field.
virtual ValidatePermissions() Validates if the user is allowed to query this entity type by checking ReadPermissionAttribute and ServiceLookupPermissionAttribute if the request is in lookup access mode.
virtual ValidateRequest() Validates the request by calling ValidatePermissions

See Also