Search Results for

    Show / Hide Table of Contents

    Class EntityContext

    Inheritance
    object
    Context
    EntityContext
    DataUpdater
    Implements
    IAsyncDisposable
    IEntityRetriever
    IDisposable
    ICustomServiceQueryHelper
    Inherited Members
    Context.DatabaseCacheFactory
    Context._deletesModified
    Context._insertsModified
    Context._updatesModified
    Context.GetCanvas()
    Context.SetTimeout(int?)
    Context.InitUser(UserInfo)
    Context.InternalClearOnFail()
    Context.AddToSaveInsertOfItem(IBaseEntity)
    Context.AddToSaveUpdateOfItem(IBaseEntity)
    Context.AddToSaveDeleteOfItem(IBaseEntity)
    Context.IsItemAlreadyInDelete(IBaseEntity)
    Context.BypassItemValidation(IBaseEntity)
    Context.AddCustomSQLToEnd(string)
    Context.AddCustomActionToSaveComplete(Func<IEntityUpdater, Task>)
    Context.AddCustomSQLToStart(string)
    Context.UseTransaction(DbTransaction)
    Context.OnSaveComplete()
    Context.AddSaveDateTimeStampHandler(Action<DateTimeOffset>)
    Context.PerformValidations()
    Context.PerformCustomInitializations()
    Context.IsSameTypeForDatabaseTables(IBaseEntity, IBaseEntity)
    Context.Dispose()
    Context.DisposeAsync()
    Context.DisposeAsyncCore()
    Context.User
    Context.CanvasID
    Context.SafeID
    Context.Transaction
    Context.Connection
    Context.Services
    Context.Accessor
    Context.CommandTimeout
    Context.HasChanges
    Context.PromotingItemsFromCanvas
    Context.CommitedDateTime
    Context.IsDisposed
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Connections.Database.Context
    Assembly: LemonEdge.Database.Connector.dll
    Syntax
    public class EntityContext : Context, IAsyncDisposable, IEntityRetriever, IDisposable, ICustomServiceQueryHelper

    Constructors

    EntityContext(IDataAccessor, IApplicationDbContextFactory, IDatabaseCacheFactory, IDatabaseConnectorServiceContext, IStorageServiceFactory)

    Declaration
    public EntityContext(IDataAccessor accessor, IApplicationDbContextFactory dbContextFactory, IDatabaseCacheFactory cacheFactory, IDatabaseConnectorServiceContext dbConnectorServices, IStorageServiceFactory storageServiceFactory)
    Parameters
    Type Name Description
    IDataAccessor accessor
    IApplicationDbContextFactory dbContextFactory
    IDatabaseCacheFactory cacheFactory
    IDatabaseConnectorServiceContext dbConnectorServices
    IStorageServiceFactory storageServiceFactory

    Fields

    _cache

    Declaration
    protected readonly ConcurrentDictionary<(Guid ID, Type Type), IBaseEntity> _cache
    Field Value
    Type Description
    ConcurrentDictionary<(Guid ID, Type Type), IBaseEntity>

    _token

    Declaration
    protected CancellationToken _token
    Field Value
    Type Description
    CancellationToken

    Properties

    Cache

    Declaration
    public override IReadOnlyCache Cache { get; set; }
    Property Value
    Type Description
    IReadOnlyCache
    Overrides
    Context.Cache

    GetUseAsOfDate

    The as of date all queries in the context are running in. You should not change this for a system provided IENtityRetriever, however you can get a new IEntityRetriever and run that with any As Of Date you wish

    Declaration
    public DateTimeOffset? GetUseAsOfDate { get; }
    Property Value
    Type Description
    DateTimeOffset?

    GetUseLabels

    If this context is running within a server, or for non UI displayed reasons, you don't need queries returning labels. This significantly imprives the speed of queries that have a lot of relationships.

    This indicates if queries will populate _Label fields for relationships by default or not

    Declaration
    public bool GetUseLabels { get; }
    Property Value
    Type Description
    bool

    IsBusy

    Declaration
    protected override bool IsBusy { get; }
    Property Value
    Type Description
    bool
    Overrides
    Context.IsBusy

    IsDirectDBConnection

    Indicates if this context is directly connected to the database server or not

    Used by certain validation that you only want to run when connected to the db as could be expensive.

    If not connected it wont be run, but will be run by the service when it processes the changes and performs its own validation
    Declaration
    public bool IsDirectDBConnection { get; }
    Property Value
    Type Description
    bool

    IsODataQuery

    Indicates if this underlying query is being executed through a web service or direct db connection

    If this is a direct db connection some queries are changed to make sure the results are consistent across service or direct db connection.

    For instance string comparisons are case insensitive against the database so we change comparisons to use ToLower to make sure in memory queries provide the same results. We can't do this on an OData query as ToLower isn't translatable from Linq to OData, and the odata web service implementation is performing a case insensitive comparison anyway

    Declaration
    public bool IsODataQuery { get; }
    Property Value
    Type Description
    bool

    TeamID

    Declaration
    public Guid TeamID { get; }
    Property Value
    Type Description
    Guid

    UniqueContextID

    Unique id for each instance of a context

    Declaration
    public Guid UniqueContextID { get; }
    Property Value
    Type Description
    Guid

    Methods

    AddItemByIDToCache(IBaseEntity)

    Returns true if added, false if already in cache

    Declaration
    public bool AddItemByIDToCache(IBaseEntity item)
    Parameters
    Type Name Description
    IBaseEntity item
    Returns
    Type Description
    bool

    ClearAsOfDate()

    Declaration
    protected void ClearAsOfDate()

    ClearChanges()

    Declaration
    public override void ClearChanges()
    Overrides
    Context.ClearChanges()

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    Context.Dispose(bool)

    ExecuteCustomQuery<T>(string, params object[])

    Executes the specified CustomServiceQueryExtender<T> which enables LINQ style queries to join across all entities in the system in one query

    Declaration
    public Task<IEnumerable<T>> ExecuteCustomQuery<T>(string customQueryName, params object[] parameters) where T : IBaseEntity
    Parameters
    Type Name Description
    string customQueryName

    The name of the method in the class that inherits the CustomServiceQueryExtender that you want to execute

    object[] parameters

    A param array of parameters to be passed to this method

    Returns
    Type Description
    Task<IEnumerable<T>>

    A task holding the results of executing the custom LINQ query

    Type Parameters
    Name Description
    T

    The type of item returned by the CustomServiceQueryExtender

    Remarks

    The QueryableExecuter works for retrieveing and querying results easily through this interface that abstracts if its running through the web service or directly to the database. However it only allows queries against one type of entity.

    Using a CustomServiceQueryExtender<T> enables you to create a normal IQueryable query that joins across multiple entity types, and is dynamically translated into sql for you. Again this works across the web service or directly connected to the database.

    See CustomServiceQueryExtender<T> for more information, but the intention is that these are used only for queries across multiple entity types for performance. All other queries can be resolved using QueryableExecuter which are faster and more efficient for querying individual entity types that do not require joins.

    See Also
    CustomServiceQueryExtender<T>

    ExecuteQuery(QueryableExecuter)

    Takes a QueryableExecuter and executes the query against the database (possibly via a web service) and returns the results

    If this context contains any changes of the query entity type then those changes won't be overwritten by the results, they will be included if they match the QueryableExecuter filter

    Declaration
    public virtual Task<IEnumerable<IBaseEntity>> ExecuteQuery(QueryableExecuter items)
    Parameters
    Type Name Description
    QueryableExecuter items

    The queryable executer containing the definition of the query to execute. Can be created from GetItems(Type)

    Returns
    Type Description
    Task<IEnumerable<IBaseEntity>>

    A task holding the result set of the query as an enumeration

    ExecuteQueryAsCSV(DateTimeOffset?, Guid?, string, string, string)

    Executes the specified query and returns the results as a CSV file in bytes

    Declaration
    public Task<byte[]> ExecuteQueryAsCSV(DateTimeOffset? asOfDate, Guid? CanvasID, string typeKey, string base64SerializedQueryExecuter, string base64SerializedColumnsToReturn)
    Parameters
    Type Name Description
    DateTimeOffset? asOfDate

    Runs the query using the specified As Of Date. Null indicates no as of date, and to just use the current data.

    Guid? CanvasID
    string typeKey

    The key (UniqueKey) of the entity type we want to run a query against.

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter containing the query to execute against this type typeKey of entities

    string base64SerializedColumnsToReturn

    A serialized string of an array of ColumnDescriptor indicating the properties for the type to return. Null indicates all properties for this entity type.

    Returns
    Type Description
    Task<byte[]>

    A Task holding the result of running the specified query, converting the results to a formatted csv file and then to a byte array

    ExecuteQueryFromSQL(Type, string, Guid)

    Declaration
    protected Task<IEnumerable<IBaseEntity>> ExecuteQueryFromSQL(Type t, string sql, Guid forType = default)
    Parameters
    Type Name Description
    Type t
    string sql
    Guid forType
    Returns
    Type Description
    Task<IEnumerable<IBaseEntity>>

    ExecuteQueryFromSQL<T>(string, Guid)

    Declaration
    public Task<IEnumerable<T>> ExecuteQueryFromSQL<T>(string sql, Guid forType = default) where T : IBaseEntity
    Parameters
    Type Name Description
    string sql
    Guid forType
    Returns
    Type Description
    Task<IEnumerable<T>>
    Type Parameters
    Name Description
    T

    ExecuteQuery<T>(QueryableExecuter<T>)

    Takes a QueryableExecuter<T> and executes the query against the database (possibly via a web service) and returns the results

    If this context contains any changes of type T then those changes won't be overwritten by the results, they will be included if they match the QueryableExecuter filter

    Declaration
    public Task<IEnumerable<T>> ExecuteQuery<T>(QueryableExecuter<T> items) where T : IBaseEntity
    Parameters
    Type Name Description
    QueryableExecuter<T> items

    The queryable executer containing the definition of the query to execute. Can be created from GetItems<T>()

    Returns
    Type Description
    Task<IEnumerable<T>>

    A task holding the result set of the query as an enumeration

    Type Parameters
    Name Description
    T

    The type of items we are executing a query against

    ExecuteSQLResultsAsCSV(Guid, string, string, string)

    Executes the specified ISQLWrapper and returns the results as a byte array of a csv fotmatted file of the results

    Declaration
    public Task<byte[]> ExecuteSQLResultsAsCSV(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedExecuteQueryAsCSVQueryExecuter, string base64SerializedColumnsToReturn)
    Parameters
    Type Name Description
    Guid sqlWrapperID

    The ID of the SQL Wrapper to execute

    string base64SerializedParameters

    A serialized Dictionary<TKey, TValue> of String, String, holding the parameters for this query. The key the ParameterName for the paramater, and the value the value

    string base64SerializedExecuteQueryAsCSVQueryExecuter
    string base64SerializedColumnsToReturn

    A serialized string of an array of ColumnDescriptor indicating the columns for the SQLWrapper query to return. Null indicates all columns defined in this SQLWrapper.

    Returns
    Type Description
    Task<byte[]>

    A Task holding the result of running the specified query, converting the results to a formatted csv file and then to a byte array

    GenericExecuteQueryAsCSV<T, TT>(EntityDescriptor, DateTimeOffset?, Guid?, string, string)

    Declaration
    public Task<byte[]> GenericExecuteQueryAsCSV<T, TT>(EntityDescriptor desc, DateTimeOffset? asOfDate, Guid? CanvasID, string base64SerializedQueryExecuter, string base64SerializedColumnsToReturn) where T : IBaseEntity where TT : T
    Parameters
    Type Name Description
    EntityDescriptor desc
    DateTimeOffset? asOfDate
    Guid? CanvasID
    string base64SerializedQueryExecuter
    string base64SerializedColumnsToReturn
    Returns
    Type Description
    Task<byte[]>
    Type Parameters
    Name Description
    T
    TT

    GenericExecuteQueryCount<T, TT>(EntityDescriptor, DateTimeOffset?, Guid?, string, string)

    Declaration
    public Task<int> GenericExecuteQueryCount<T, TT>(EntityDescriptor desc, DateTimeOffset? asOfDate, Guid? CanvasID, string base64SerializedQueryExecuter, string base64SerializedColumnsToReturn) where T : IBaseEntity where TT : T
    Parameters
    Type Name Description
    EntityDescriptor desc
    DateTimeOffset? asOfDate
    Guid? CanvasID
    string base64SerializedQueryExecuter
    string base64SerializedColumnsToReturn
    Returns
    Type Description
    Task<int>
    Type Parameters
    Name Description
    T
    TT

    GetChangedItem(Type, Guid)

    Declaration
    protected virtual IBaseEntity GetChangedItem(Type t, Guid id)
    Parameters
    Type Name Description
    Type t
    Guid id
    Returns
    Type Description
    IBaseEntity

    GetFromStorage(Guid, Guid?, string, string, bool, Guid?)

    Declaration
    public Task<byte[]> GetFromStorage(Guid typeID, Guid? id, string fileName, string folder, bool restricted, Guid? taskId = null)
    Parameters
    Type Name Description
    Guid typeID
    Guid? id
    string fileName
    string folder
    bool restricted
    Guid? taskId
    Returns
    Type Description
    Task<byte[]>

    GetGenericExecuteQueryBuilder<T, TT>(EntityDescriptor, DateTimeOffset?, Guid?, QueryableExecuter<T, TT>, List<ColumnDescriptor>)

    Declaration
    public Task<(IQuerySelectBuilder sb, List<string> colsToReturn, List<string> subColsToReturn, List<Type> colsType, Dictionary<string, string> colChanges)> GetGenericExecuteQueryBuilder<T, TT>(EntityDescriptor desc, DateTimeOffset? asOfDate, Guid? CanvasID, QueryableExecuter<T, TT> executer, List<ColumnDescriptor> cols) where T : IBaseEntity where TT : T
    Parameters
    Type Name Description
    EntityDescriptor desc
    DateTimeOffset? asOfDate
    Guid? CanvasID
    QueryableExecuter<T, TT> executer
    List<ColumnDescriptor> cols
    Returns
    Type Description
    Task<(IQuerySelectBuilder sb, List<string> colsToReturn, List<string> subColsToReturn, List<Type> colsType, Dictionary<string, string> colChanges)>
    Type Parameters
    Name Description
    T
    TT

    GetItemByID(Type, Guid)

    Returns the item of type type specified by the id

    Declaration
    public Task<IBaseEntity> GetItemByID(Type t, Guid id)
    Parameters
    Type Name Description
    Type t
    Guid id

    The ID of the entity to return

    Returns
    Type Description
    Task<IBaseEntity>

    A task holding the result of the request

    GetItemByID<T>(Guid)

    Returns the item of type T specified by the id

    Declaration
    public Task<T> GetItemByID<T>(Guid id) where T : IBaseEntity
    Parameters
    Type Name Description
    Guid id

    The ID of the entity to return

    Returns
    Type Description
    Task<T>

    A task holding the result of the request

    Type Parameters
    Name Description
    T

    The type of entity to return

    GetItems(Type)

    Returns a new QueryableExecuter for the specified type of item. This can be used to create a query for retrieveing certain items of type type, which can be executed using ExecuteQuery(QueryableExecuter)

    Declaration
    public QueryableExecuter GetItems(Type type)
    Parameters
    Type Name Description
    Type type

    The type of items that the QueryableExecuter can query

    Returns
    Type Description
    QueryableExecuter

    The new QueryableExecuter for this specified type

    GetItems<T>()

    Returns a new QueryableExecuter<T> for the specified type of item. This can be used to create a query for retrieveing certain items of type T, which can be executed using ExecuteQuery<T>(QueryableExecuter<T>)

    Declaration
    public QueryableExecuter<T> GetItems<T>() where T : IBaseEntity
    Returns
    Type Description
    QueryableExecuter<T>

    The new QueryableExecuter for this specified type

    Type Parameters
    Name Description
    T

    The type of items that the QueryableExecuter can query

    GetQueryCount(DateTimeOffset?, Guid?, string, string, string)

    Executes the specified query and returns the count of the matching results

    Declaration
    public Task<int> GetQueryCount(DateTimeOffset? asOfDate, Guid? CanvasID, string typeKey, string base64SerializedQueryExecuter, string base64SerializedColumnsToReturn)
    Parameters
    Type Name Description
    DateTimeOffset? asOfDate

    Runs the query using the specified As Of Date. Null indicates no as of date, and to just use the current data.

    Guid? CanvasID
    string typeKey

    The key (UniqueKey) of the entity type we want to run a query against.

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter containing the query to execute against this type typeKey of entities

    string base64SerializedColumnsToReturn

    A serialized string of an array of ColumnDescriptor indicating the properties for the type to return. Null indicates all properties for this entity type.

    Returns
    Type Description
    Task<int>

    A task holding the count of the row results from running the specified query

    GetQueryableFromSQL<T>(string, Guid)

    Declaration
    public IQueryable<T> GetQueryableFromSQL<T>(string sql, Guid forType = default) where T : IBaseEntity
    Parameters
    Type Name Description
    string sql
    Guid forType
    Returns
    Type Description
    IQueryable<T>
    Type Parameters
    Name Description
    T

    GetQueryableItems<T>(out IQueryLock, Guid)

    Declaration
    public IQueryable<T> GetQueryableItems<T>(out IQueryLock lockReleaserAfterQueryableExecution, Guid forType = default) where T : IBaseEntity
    Parameters
    Type Name Description
    IQueryLock lockReleaserAfterQueryableExecution
    Guid forType
    Returns
    Type Description
    IQueryable<T>
    Type Parameters
    Name Description
    T

    GetSQLCall(EntityDescriptor, long, Guid?, Guid, Guid?, bool, DateTimeOffset?, Guid?)

    Declaration
    public static string GetSQLCall(EntityDescriptor desc, long accountID, Guid? canvasID, Guid teamID, Guid? userID, bool useLabels, DateTimeOffset? asOfDate, Guid? userSpecificID)
    Parameters
    Type Name Description
    EntityDescriptor desc
    long accountID
    Guid? canvasID
    Guid teamID
    Guid? userID
    bool useLabels
    DateTimeOffset? asOfDate
    Guid? userSpecificID
    Returns
    Type Description
    string

    GetSQLCall(EntityDescriptor, Guid?, bool, DateTimeOffset?, Guid?)

    Declaration
    public string GetSQLCall(EntityDescriptor desc, Guid? CanvasID, bool useLabels, DateTimeOffset? asOfDate, Guid? userSpecificID)
    Parameters
    Type Name Description
    EntityDescriptor desc
    Guid? CanvasID
    bool useLabels
    DateTimeOffset? asOfDate
    Guid? userSpecificID
    Returns
    Type Description
    string

    GetSQLResults(Guid, Dictionary<string, string>, QueryableExecuter, List<string>)

    Declaration
    public Task<IEnumerable<ISQLWrapperResult>> GetSQLResults(Guid sqlWrapperID, Dictionary<string, string> parameters, QueryableExecuter queryableExecuter, List<string> columnsToReturn)
    Parameters
    Type Name Description
    Guid sqlWrapperID
    Dictionary<string, string> parameters
    QueryableExecuter queryableExecuter
    List<string> columnsToReturn
    Returns
    Type Description
    Task<IEnumerable<ISQLWrapperResult>>

    GetSQLResults(Guid, string, string, string, CancellationToken)

    Executes the specified ISQLWrapper and returns the results set of ISQLWrapperResults. SQLWrapperInterpretor can be used to interrogate the values of each result item.

    Declaration
    public Task<IEnumerable<ISQLWrapperResult>> GetSQLResults(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter, string base64SerializedColumnsToReturn, CancellationToken token = default)
    Parameters
    Type Name Description
    Guid sqlWrapperID

    The ID of the SQL Wrapper to execute

    string base64SerializedParameters

    A serialized Dictionary<TKey, TValue> of String, String, holding the parameters for this query. The key the ParameterName for the paramater, and the value the value

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter<T> of type ISQLWrapperResult containing the query to execute against this result set

    string base64SerializedColumnsToReturn
    CancellationToken token
    Returns
    Type Description
    Task<IEnumerable<ISQLWrapperResult>>

    A task holding the results of your query. SQLWrapperInterpretor can be used to interrogate the values of each result item.

    Remarks

    This function is extremely powerful as it allows you to execute any custm created SQLWrapper to get high performant results from a context anywhere within your application code

    See Also
    GetSQLResults<T>(Guid, string, string)

    GetSQLResultsClassCount<T, TT>(Guid, string, string)

    Declaration
    public Task<int> GetSQLResultsClassCount<T, TT>(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter) where TT : class, T, new()
    Parameters
    Type Name Description
    Guid sqlWrapperID
    string base64SerializedParameters
    string base64SerializedQueryExecuter
    Returns
    Type Description
    Task<int>
    Type Parameters
    Name Description
    T
    TT

    GetSQLResultsClass<T, TT>(Guid, string, string)

    Declaration
    public Task<IEnumerable> GetSQLResultsClass<T, TT>(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter) where TT : class, T, new()
    Parameters
    Type Name Description
    Guid sqlWrapperID
    string base64SerializedParameters
    string base64SerializedQueryExecuter
    Returns
    Type Description
    Task<IEnumerable>
    Type Parameters
    Name Description
    T
    TT

    GetSQLResultsCount(Guid, string, string)

    Executes the specified sqlWrapperID and returns the count of the results

    Declaration
    public Task<int> GetSQLResultsCount(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter)
    Parameters
    Type Name Description
    Guid sqlWrapperID

    The ID of the SQL Wrapper to execute

    string base64SerializedParameters

    A serialized Dictionary<TKey, TValue> of String, String, holding the parameters for this query. The key the ParameterName for the paramater, and the value the value

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter<T> of type ISQLWrapperResult containing the query to execute against this result set

    Returns
    Type Description
    Task<int>

    A task holding the count of the number of items that would be returned from executing this query

    GetSQLResultsCount<T>(Guid, string, string)

    Executes the specified sqlWrapperID and returns the count of the specified custom types (either or complex or entity types) that have properties matching the Name of the columns returned by the SQLWrapper

    Declaration
    public Task<int> GetSQLResultsCount<T>(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter)
    Parameters
    Type Name Description
    Guid sqlWrapperID

    The ID of the SQL Wrapper to execute

    string base64SerializedParameters

    A serialized Dictionary<TKey, TValue> of String, String, holding the parameters for this query. The key the ParameterName for the paramater, and the value the value

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter<T> of type T containing the query to execute against this result set

    Returns
    Type Description
    Task<int>

    A task holding the count of the number of results that would be returned from executing this query

    Type Parameters
    Name Description
    T

    The type (eith a complex or entity type) that has properties matching the columns returned by the query

    GetSQLResultsJson(Guid, Dictionary<string, string>, QueryableExecuter, List<string>)

    Declaration
    public Task<IEnumerable<Dictionary<string, object>>> GetSQLResultsJson(Guid sqlWrapperID, Dictionary<string, string> parameters, QueryableExecuter queryableExecuter, List<string> columnsToReturn)
    Parameters
    Type Name Description
    Guid sqlWrapperID
    Dictionary<string, string> parameters
    QueryableExecuter queryableExecuter
    List<string> columnsToReturn
    Returns
    Type Description
    Task<IEnumerable<Dictionary<string, object>>>

    GetSQLResults<T>(Guid, string, string)

    Executes the specified sqlWrapperID and returns the results set as a collection of specified custom types (either or complex or entity types) that have properties matching the Name of the columns returned by the SQLWrapper

    Declaration
    public Task<IEnumerable<T>> GetSQLResults<T>(Guid sqlWrapperID, string base64SerializedParameters, string base64SerializedQueryExecuter)
    Parameters
    Type Name Description
    Guid sqlWrapperID

    The ID of the SQL Wrapper to execute

    string base64SerializedParameters

    A serialized Dictionary<TKey, TValue> of String, String, holding the parameters for this query. The key the ParameterName for the paramater, and the value the value

    string base64SerializedQueryExecuter

    The serialization string of a QueryableExecuter<T> of type T containing the query to execute against this result set

    Returns
    Type Description
    Task<IEnumerable<T>>

    A task holding the results of the query

    Type Parameters
    Name Description
    T

    The type (eith a complex or entity type) that has properties matching the columns returned by the query

    ReleaseQueryLock()

    Releases the lock held during execution of a query. MUST be released after execution.

    Declaration
    public void ReleaseQueryLock()

    SetAccountID(long)

    Declaration
    public void SetAccountID(long id)
    Parameters
    Type Name Description
    long id

    SetCancellationToken(CancellationToken)

    Declaration
    public void SetCancellationToken(CancellationToken token)
    Parameters
    Type Name Description
    CancellationToken token

    SetTeamID(Guid)

    Declaration
    public void SetTeamID(Guid teamID)
    Parameters
    Type Name Description
    Guid teamID

    UseAsOfDate(DateTimeOffset)

    Specifies the as of date all queries in the context are running in. You should not change this for a system provided IENtityRetriever, however you can get a new IEntityRetriever and run that with any As Of Date you wish

    If you are returning items as of a prior point in time you should not attempt to modify them - it will fail

    Declaration
    public IEntityRetriever UseAsOfDate(DateTimeOffset asOfDate)
    Parameters
    Type Name Description
    DateTimeOffset asOfDate

    The as of date to use for running queries from this context with.

    Returns
    Type Description
    IEntityRetriever

    The current context so commands can be chained

    UseCanvas(Guid)

    Declaration
    public override IEntityRetriever UseCanvas(Guid canvasId)
    Parameters
    Type Name Description
    Guid canvasId
    Returns
    Type Description
    IEntityRetriever
    Overrides
    Context.UseCanvas(Guid)

    UseLabels(bool)

    Indicates if items returned will have relationship fields with _Label properties automatically populated or not.

    This is only required for items that are displayed in the UI, all other items don't need this and can benefit from performance improvements

    Declaration
    public IEntityRetriever UseLabels(bool useLabels)
    Parameters
    Type Name Description
    bool useLabels

    Indicates if queries should use labels or not

    Returns
    Type Description
    IEntityRetriever

    The current context so commands can be chained

    VerifyFunctions(EntityDescriptor)

    Declaration
    public Task<bool> VerifyFunctions(EntityDescriptor desc)
    Parameters
    Type Name Description
    EntityDescriptor desc
    Returns
    Type Description
    Task<bool>

    Implements

    IAsyncDisposable
    IEntityRetriever
    IDisposable
    ICustomServiceQueryHelper

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.