RetrieveRequestHandlerBase<TRow,TRetrieveRequest,TRetrieveResponse> class
namespace: Serenity.Services assembly: Serenity.Net.Services
Abstract base class for retrieve request handlers that share state and mode neutral helper methods between synchronous and asynchronous retrieve request handlers.
public abstract class RetrieveRequestHandlerBase<TRow, TRetrieveRequest, TRetrieveResponse> :
IRetrieveRequestHandler
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 |
| context |
Request context |
Public Members
| name |
description |
| Cache { get; } |
Gets the two level cache from the request context. |
| Connection { get; protected set; } |
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; protected set; } |
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. |
Protected Members
| name |
description |
| RetrieveRequestHandlerBase(…) |
Abstract base class for retrieve request handlers that share state and mode neutral helper methods between synchronous and asynchronous retrieve request handlers. |
| 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 GetBehaviors() |
Gets the list of retrieve behaviors. |
| IsIncluded(…) |
Returns true if field is included in IncludeColumns (2 methods) |
| 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. |
Exceptions
| exception |
condition |
| ArgumentNullException |
context is null. |
Initializes a new instance of the class.
See Also