Skip to main content

easyqueryoptions-class

Contains various options used in EasyQueryMiddleware, EasyQueryManager and other classes.

public class Korzh.EasyQuery.Services.EasyQueryOptions

Assembly: Korzh.EasyQuery.dll

Constructors

NameTypeDescription
EasyQueryOptions()voidInitializes a new instance of the Korzh.EasyQuery.Services.EasyQueryOptions class.

Properties

NameTypeDescription
AuthProviderResolverFunc<EasyQueryManager, IEqAuthProvider>Gets the authentication provider resolver - a function that (most possibly) creates and returns an instance of Korzh.EasyQuery.Services.IEqAuthProvider interface.
AutoResolveModelOnQueryLoadboolGets or sets a value indicating whether we need to resolve the model on query load if the model itself is not loaded yet.
BuilderTunersList<Action<EasyQueryManager>>Gets the list of the builder tuners. Each tuner - is a function which allows to modify some options of the current query builder
BuildQueryOnSyncboolGets or sets the value indicating whether we need to build query on every SyncQuery request and attach the statement to the response.
BuildWithParametersboolGets or sets the value indicating whether the query will be built with parameters instead of injected values
CachingServiceResolverFunc<EasyQueryManager, IEqCachingService>Gets the caching service resolver
ConnectionResolverFunc<EasyQueryManager, object>Gets the connection resolver - a function which creates and returns the database connection (or the context collection in case LINQ manager).
ConnectionStringstringGets or sets the connection string to a database. Usually this property is used together with UseDbConnection and UseDbConnectionModelLoader extension methods to avoid defining the connection string separately in each of these methods' parameters.
DataExportTunersIList<IDataExportTuner>Gets the collection of data export tuners. Each tuner is called before exporting the datadata.
DbCommandTunerAction<object>Gets or sets the tune for database commands. Here you can set, for example, the timeout of your DB requests.
DebugModeboolGets or sets a value indicating whether the debug mode is enabled
DefaultModelIdstringGets or sets the default model identifier. This option is used with FileModelLoader (when no other model loader is defined) if the client side scripts don't pass any particular model ID in requests
EndpointstringGets or sets the endpoint of EasyQuery middleware. This will be the base part of all URLs where all EasyQuery requests are sent to. The default value is /api/easyquery, so the request to get the data model by its ID will have the following URL: /api/easyquery/models/{modelId}
ManagerResolverManagerResolverFuncGets the resolver which creates an instance of EasyQuery Manager (a descendant of EasyQueryManagerBase class). This class defines all basic operations with the models and queries: creating, loading, saving, query building itself.
ManagerTunerAction<EasyQueryManager>Gets or sets the tune for EasyQuery Manager.
ModelLoaderResolverFunc<EasyQueryManager, IModelLoader>Gets the model loader resolver - a function which creates and returns an instance of IModelLoader interface.
ModelTunerAction<EasyQueryManager>Gets the model tuner - an action which is called after the model loading and allows to "tune" your model before sending it to the client-side.
PreFetchTunersIList<IEasyQueryManagerTuner>Gets the collection of pre fetch tuners. Each tuner is called before fetching the data.
QueryRecordCountboolGets or sets a value indicating whether the service should send one more query to get the total number of records for the main query (when the Paging is enabed).
QueryStoreResolverFunc<EasyQueryManager, IQueryStore>Gets the query store resolver - a function which creates and returns an object which implements IQueryStore interface
QueryTunerAction<EasyQueryManager>Gets the model tuner - an action which is called after the query loading from store 0r from clien-side request.
ReturnQueryOnSaveboolGets or sets the value indicating whether the query will returned back to the client when handling the "SaveQuery" request. You might want to set this option to true if the query can be changing when is saved to the storage (e.g. we assign some itnernal ID for it).\ and you want to let the client know about those changes.
ReturnQueryStatementOnFetchboolGets or sets the value indicating whether we need to attach the statement with the response to FetchData request.
SaveNewQueryboolGets or sets the value indicating whether the new query must be saved to the store (defined by UseQueryStore method) before return it as a response on NewQuery request.
SaveQueryOnSyncboolGets or sets the value indicating whether the query will be saved to the store (defined by UseQueryStore method) on each SyncQuery request.
StoreModelInCacheboolGets or sets the value indicating whether we need to store the model in cache (which is defined separately).
StoreQueryInCacheboolGets or sets the value indicating whether we need to store the query in cache (which is defined separately).
UseTimezoneOffsetboolGets or sets the value indicating whether users timezone offset should be applied to the query and result
UseUtcTimeboolGets or sets the value indicating whether we should use UTC time when querying agains date/time fields
ValueListResolversList<IValueListResolver>Gets the collection of value list resolvers. Each value list resolver can process one special case of the lists. For example SqlValueListResolver returns the list of values by SQL statement (like list of countries or list of some categories).

Methods

NameTypeDescription
AddBuilderTuner(Action<EasyQueryManager> builderTuner)voidAdds the builder tuner.
AddDataExportTuner(IDataExportTuner tuner)voidAdds the tuner which is called before the exporting result.
AddDataExportTuner(Func<EasyQueryManager, string, IDataExportSettings, bool> tunerFunc)voidAdds the tuner which is called before the exporting result.
AddDataExportTuner(Func<EasyQueryManager, IDataExportSettings, bool> tunerFunc)voidAdds the tuner which is called before the exporting result.
AddFileExtensionResolver(Func<string, string> fileExtensionResolver)voidAdds a function that returns the file extension by content type.
AddPreExecuteTuner(IEasyQueryManagerTuner tuner)voidAdds the tuner which is called before fetching the data.
AddPreFetchTuner(IEasyQueryManagerTuner tuner)voidAdds the tuner which is called before the query execution.
AddPreFetchTuner(Action<EasyQueryManager> tuner)voidAdds the tuner which is called before the query execution.
AddValueListResolver(Func<ListRequestOptions, IEnumerable<ListItem>> resolver)voidAdds the custom value list resolver defined by a function passed in the parameter. The function takes the list name and returns the list of values or null (so, the list can't be resolved for this name) .
UseAuthProvider(Func<EasyQueryManager, IEqAuthProvider> authProviderResolver)voidAdds the authentication provider resolver - a function which returns an object with Korzh.EasyQuery.Services.IEqAuthProvider interface.
UseCaching(Func<EasyQueryManager, IEqCachingService> cachingServiceResolver)voidDefines the functions which returns the caching service by DI services
UseConnection(Func<EasyQueryManager, object> connectionResolver)voidDefines the functions which returns the connection by DI services and model ID
UseManager(ManagerResolverFunc managerResolver)voidDefines the function which creates and returns an instance of EasyQuery manager. The manager defines all basic operations with the models and queries: creating, loading, saving and query building itself.
UseManager()voidDefines the function which creates and returns an instance of EasyQuery manager. The manager defines all basic operations with the models and queries: creating, loading, saving and query building itself.
UseManagerTuner(Action<EasyQueryManager> tuner)voidDefines the namager tuner. See more about the model tuner in Korzh.EasyQuery.Services.EasyQueryOptions.ManagerTuner property description
UseModelLoader(Func<EasyQueryManager, IModelLoader> resolver)voidDefines the functions which returns the model loader - an instance of IModelLoader interface
UseModelTuner(Action<EasyQueryManager> tuner)voidDefines the model tuner. See more about the model tuner in Korzh.EasyQuery.Services.EasyQueryOptions.ModelTuner property description
UseQueryStore(Func<EasyQueryManager, IQueryStore> resolver)voidDefines the functions which returns the query store - an instance of IQueryStore interface
UseQueryTuner(Action<EasyQueryManager> tuner)voidDefines the query tuner. See more about the query tuner in Korzh.EasyQuery.Services.EasyQueryOptions.QueryTuner property description