Skip to content

EqServiceProvider class

Class EqServiceProviderDb. Provides basic functionality for building EasyQuery service to process AJAX requests from EasyQuery JavaScript widgets. Can be used to create MVC controller, WebService class or WebAPI controller

public abstract class Korzh.EasyQuery.Services.EqServiceProvider
TypeNameDescription
Func<String, String>CacheGetterGets or sets the session getter - a delegate that returns an object stored in Session by its name.
Action<String, String>CacheSetterGets or sets the session setter - an anonymous function which store some object into session.
StringDataPathGets or sets the path to the folder where (by default implemention) the model and the queries will be stored.
StringDefaultModelIdGets or sets the default name of the model. This model will loaded automatically if the name was not indicated explicitly
QueryFormatsFormatsGets or sets the formats passed to before SQL generation.
DataModelModel
Func<DataModel>ModelCreatorGets or sets the model creator - a delegate (anonymous function) which is called to create a new model object.
Action<DataModel, String>ModelLoaderGets or sets the model loader - a delegate (anonymous function) which is called to load model by name.
PagingSettingsPagingHolds different pagination settings.
QueryQuery
Func<Query, JsonDict, IQueryBuilder>QueryBuilderGets or sets the query builder - a delegate (anonymous function) which is called to build query and returns either an SQL statement or IQueryable object
Func<Query>QueryCreatorGets or sets the query creator - a delegate (anonymous function) which is called to create a new query object.
Func<String, IEnumerable<QueryListItem>>QueryListResolverGets or sets the query list resolver - a delegate (anonymous function) which is called to get list of available queries
Action<Query, String>QueryLoaderGets or sets the query loader - a delegate (anonymous function) which is called to load query by name.
Action<String>QueryRemover
Action<Query, String>QuerySaverGets or sets the query saver - a delegate (anonymous function) which is called to save query by name.
Action<Query>QuerySynchronizerSyncs query passed in parameter with the one stored in cache (if applied)
BooleanStoreModelInCacheGets or sets a value indicating whether data model will be stored in Session between requests.
BooleanStoreQueryInCacheGets or sets a value indicating whether current query will be stored in Session between requests.
StringUserId
Func<String, IEnumerable<ListItem>>ValueListResolverGets or sets the value list resolver - a delegate (anonymous function) which is called to get list of values by the list name
TypeNameDescription
QueryBuilderResultBuildQuery(Query query, JsonDict optionsDict = null, Boolean addPaging = False)Builds SQL statement by the DbQuery object. This methods calls QueryBuilder delegate to build SQL.
QueryBuilderResultBuildQueryDict(JsonDict queryDict, JsonDict optionsDict = null)Builds the query dictionary.
DataModelCreateModel()Creates new DataModel object
QueryCreateQuery()Creates new DbQuery object.
QueryFormatsCreateQueryFormats()Creates new QueryFormats object
voidDefaultModelLoader(DataModel model, String modelId)Default implementation of the model loader Korzh.EasyQuery.Services.EqServiceProvider.ModelLoader.
IEnumerable<QueryListItem>DefaultQueryListResolver(String modelId)
voidDefaultQueryLoader(Query query, String queryId)Default implementation of the query loader Korzh.EasyQuery.Services.EqServiceProvider.QueryLoader.
voidDefaultQueryRemover(String queryId)Default implementation of the query remover Korzh.EasyQuery.Services.EqServiceProvider.QueryRemover.
voidDefaultQuerySaver(Query query, String queryId)Default implementation of the query saver Korzh.EasyQuery.Services.EqServiceProvider.QuerySaver.
IEqResultSetExecuteQuery(Query query, JsonDict optionsDict = null)
IEqResultSetExecuteQueryCore(Query query, JsonDict optionsDict = null)
StringGenerateQueryId(String name)
IEnumerable<ListItem>GetList(JsonDict optionsDict)Returns custom list of values by editorId. This method is usually called by GetList action of EasyQueryController.
IEnumerable<ListItem>GetList(JsonDict optionsDict, IQueryable<T> dbSet)Returns custom list of values by editorId. This method is usually called by GetList action of EasyQueryController.
IEnumerable<ListItem>GetListCore(ListRequestOptions options)
IEnumerable<ListItem>GetListForContext(ListRequestOptions options, IQueryable<T> dbSet)
DataModelGetModel(String modelId)Gets the DbModel object by name.
QueryGetQuery(String modelId, String queryId)Gets the DbQuery object by name.
IQueryBuilderGetQueryBuilder(Query query, JsonDict optionsDict = null)
QueryGetQueryByIds(JsonDict queryDict)Get query by query ID and model ID stored in JsonDict object
QueryGetQueryByJsonDict(JsonDict queryDict)Get query by ID stored in JsonDict object
IEnumerable<QueryListItem>GetQueryList(String modelId)Gets the list of available queries.
StringGetValueFromCache(String key)Gets some string value from session by its key.
ListRequestOptionsJsonDictToListRequestOptions(JsonDict optionsDict)Converts JsonDict object to ListRequestOptions
voidLoadModelFromCache(DataModel model, String modelId)Loads DataModel from cache by ID (name)
voidLoadOptions(JsonDict optionsDict)Loads different options from JsonDict object (usually created by JSON deserialization).
voidLoadQueryById(Query query, String queryId)Loads the query by ID. Default implementation tries to load [queryId].xml file from Korzh.EasyQuery.Services.EqServiceProvider.DataPath\Queries{UserId} folder.
voidLoadQueryFromCache(Query query, String queryId)Loads Query from cache by ID
BooleanRemoveQuery(String queryId)
voidSaveModelInCache(DataModel model)Saves model into cache
BooleanSaveQuery(Query query)
QuerySaveQueryDict(JsonDict queryDict, String newQueryName)Saves the query by its JSON representation.
voidSaveQueryInCache(Query query)Saves query into cache
voidSaveValueInCache(String key, String value)Stores some string value in cache.
voidSyncQuery(Query query)Synchronizes the query.
QuerySyncQueryDict(JsonDict queryDict)Synchronizes the query by JsonDict object.