Show / Hide Table of Contents

    Interface IRepository

    Data repository (data object collection) basic interface

    Inherited Members
    IDataQuery.Alias
    IDataQuery.Layer
    IDataQuery.Context
    IDataQuery.Variables
    IDataQuery.Keys
    IDataQuery.Token
    IQueryable.ElementType
    IQueryable.Expression
    IQueryable.Provider
    IEnumerable.GetEnumerator()
    IDisposable.Dispose()
    Namespace: XData
    Assembly: XData.docfx.dll
    Syntax
    public interface IRepository : IDataQuery, IOrderedQueryable, IQueryable, IEnumerable, IDisposable

    Properties

    | Improve this Doc View Source

    Count

    Get repository object count

    Declaration
    long Count { get; }
    Property Value
    Type Description
    Int64
    | Improve this Doc View Source

    Editable

    Get editable state of repository objects

    Declaration
    bool Editable { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    FixedQuery

    Data repository fixed query

    Declaration
    bool FixedQuery { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Used to cache record set once (at first call) and have an access to cached data multiple times

    Hint: Useful when needed to read the same data multiple times according dynamic rules and all records count approximately equal or less then requests count

    Examples

    var q = dataScope.GetRepository<Some>().Where(x => x.SomeField == 1);

    q.FixedQuery = true;

    q.FirstOrDefault(x => x.OtherField == 3); //Queried across the cached data

    | Improve this Doc View Source

    HasCurrentRecord

    Check current record is assigned

    Declaration
    bool HasCurrentRecord { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Manual

    Manual repository flag

    Declaration
    bool Manual { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Manual repositories can be filled by attached objects only

    Hint: Use manual repositories to build logic filled repositories

    Hint: Use manual repositories as mock repositories for testing

    Hint: Object attaching (see Attach(T, DataObjectState, IEnumerable<KeyValuePair<String, Object>>, AttachedHandler<T>[])) set Manual property to True automatically

    WARNING! Detach objects (see Detach(Predicate<T>)) NOT set Manual property to False automatically!

    See Also
    Attach(T, DataObjectState, IEnumerable<KeyValuePair<String, Object>>, AttachedHandler<T>[])
    Detach(Predicate<T>)
    SetAttachedHandlers(ref T, AttachedHandler<T>[])
    SetAttachedHandlers(RepositoryAttachedHandler<T>[])
    | Improve this Doc View Source

    ShowSubtree

    Data repository tree modifier

    Declaration
    bool ShowSubtree { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Used to show/hide subtree related items in slave view when master is tree

    When ShowSubtree = false - slave contains selected node child items only

    When ShowSubtree = true - selected node and it's subtree child items

    Works with DirectLink: External links marked as DirectLink is filled while ShowSubtree is false and omitted otherwise

    See Also
    DirectLink

    Methods

    | Improve this Doc View Source

    Clear(DataSubmitFlag)

    Clear repository objects

    Declaration
    bool Clear(DataSubmitFlag flag = DataSubmitFlag.None)
    Parameters
    Type Name Description
    DataSubmitFlag flag
    Returns
    Type Description
    Boolean
    Remarks

    All objects corresponded current repository limitations will be deleted through single operation

    WARNING! Trigger logic BeforeDelete and AfterDelete are not used in this case!

    Use BeforeClear and AfterClear instead!

    | Improve this Doc View Source

    CloseChilds()

    Close child repositories

    Declaration
    void CloseChilds()
    | Improve this Doc View Source

    DetachChild<TChild>(String)

    Detach child repository

    Declaration
    void DetachChild<TChild>(string alias = null)
        where TChild : class, IDataObject, new()
    Parameters
    Type Name Description
    String alias
    Type Parameters
    Name Description
    TChild
    | Improve this Doc View Source

    FindParent<TParent>(out IRepository<TParent>, String)

    Find parent repository

    Declaration
    bool FindParent<TParent>(out IRepository<TParent> parent, string alias = null)
        where TParent : class, IDataObject, new()
    Parameters
    Type Name Description
    IRepository<TParent> parent

    Parent repository

    String alias

    Parent repository alias

    Returns
    Type Description
    Boolean

    Find success

    Type Parameters
    Name Description
    TParent

    Parent repository type

    | Improve this Doc View Source

    GetChild<TChild>(String, ISecuritySession, Variable[])

    Get a child repository

    Declaration
    IRepository<TChild> GetChild<TChild>(string alias = null, ISecuritySession security = null, params Variable[] variables)
        where TChild : class, IDataObject, new()
    Parameters
    Type Name Description
    String alias

    Child alias

    ISecuritySession security

    Security session

    Variable[] variables

    Child variables

    Returns
    Type Description
    IRepository<TChild>

    Repository

    Type Parameters
    Name Description
    TChild

    Child type

    Remarks

    If child repository not exists it will be created and linked to base repository as a child

    When alias parameter value is not set child object type name used as child repository alias

    See Also
    DetachChild<TChild>(String)
    CloseChilds()
    | Improve this Doc View Source

    Refresh()

    Refresh repository data cache

    Declaration
    void Refresh()

    Extension Methods

    DataObjectExtensions.GetParameter<T>(IDataQuery, String)
    DataObjectExtensions.GetResultSet<TRes>(IDataQuery, String)
    DataObjectExtensions.GetResultSet<TRes>(IDataQuery, Expression<Func<IEnumerable<TRes>>>)
    SerializationExtensions.ToXml<T>(T)
    AsyncExtensions.GetParameterAsync<T>(IDataQuery, String)
    AsyncExtensions.GetResultSetAsync<TRes>(IDataQuery, String)
    AsyncExtensions.GetResultSetAsync<TRes>(IDataQuery, Expression<Func<IEnumerable<TRes>>>)
    CollectionsExtensions.SetValue<TKey, T>(TKey, T)
    CollectionsExtensions.AsEnum<T>(T)
    DataObjectQueryableExtensions.CompareVariable(Object, FilterOperation, String)
    Processing.Do<T>(T, Action<IProcess<T>>[])
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>)
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>, TResult)
    TypeExtensions.ChangeType<T>(Object)
    TypeExtensions.ChangeType(Object, Type)
    TypeExtensions.InvokeMethod<TRet>(Object, Type[], Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Type[], Expression<Action>, BindingFlags)
    TypeExtensions.InvokeMethod<TRet>(Object, Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Expression<Action>, BindingFlags)
    SqlBlockExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IBlockQueryAdapter, TResult>>)
    QueryDescriptionExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IQueryStructureAdapter, TResult>>)

    See Also

    IRepository<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX