RetrieveRequestHandler<TRow,TRetrieveRequest,TRetrieveResponse> class
namespace: Serenity.Services assembly: Serenity.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(…) |
Creates an instance of the class |
Cache { get; } |
Gets the two level cache from the request context |
Connection { get; } |
Gets current connection |
Context { get; } |
Gets the request context |
Localizer { get; } |
Gets localizer from the request context |
Permissions { get; } |
Gets permission service from the request context |
Query { get; } |
Gets the select query |
Request { get; protected set; } |
Response object |
Response { get; protected set; } |
Response object |
Row { get; protected set; } |
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 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 is read permission, selectlevel.never flag, and lookup access mode |
virtual CreateQuery() |
Creates a query instance with the dialect for current connection. |
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