Show / Hide Table of Contents

    Interface ISqlBlockAdapter

    SQL block adapter

    Namespace: XData.Database.SqlBlock
    Assembly: XData.docfx.dll
    Syntax
    public interface ISqlBlockAdapter

    Methods

    | Improve this Doc View Source

    Block(Expression<Func<ISqlBlockAdapter, ISqlBlock>>[])

    Complex SQL block fences BEGIN...END

    Declaration
    ISqlBlock Block(params Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] blocks)
    Parameters
    Type Name Description
    Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] blocks

    Contained SQL blocks

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Block(String)

    Custom SQL block

    Declaration
    ISqlBlock Block(string customSqlBlock)
    Parameters
    Type Name Description
    String customSqlBlock

    Custom SQL block code

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Block<T>(Expression<Func<ISqlBlockAdapter<T>, ISqlBlock>>[])

    Complex SQL block fences BEGIN...END

    Declaration
    ISqlBlock Block<T>(params Expression<Func<ISqlBlockAdapter<T>, ISqlBlock>>[] blocks)
        where T : class, new()
    Parameters
    Type Name Description
    Expression<Func<ISqlBlockAdapter<T>, ISqlBlock>>[] blocks

    Contained SQL blocks

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T

    Returned object type

    See Also
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Declare(Expression<Func<ISqlVariable, ISqlValue>>[])

    Declare variables SQL block

    Declaration
    ISqlBlock Declare(params Expression<Func<ISqlVariable, ISqlValue>>[] variables)
    Parameters
    Type Name Description
    Expression<Func<ISqlVariable, ISqlValue>>[] variables

    Variable declaration descriptions

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Delete(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>>)

    DELETE SQL block

    Declaration
    ISqlBlock Delete(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> query)
    Parameters
    Type Name Description
    Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> query

    Delete query structure

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    ForEach<T>(Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>>, String, Expression<Func<ISqlBlockAdapter, ISqlBlock>>, Expression<Action<ILoopVariableAdapter<T>>>[])

    Cursor iteration SQL block

    Declaration
    ISqlBlock ForEach<T>(Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>> selectQuery, string cursorName, Expression<Func<ISqlBlockAdapter, ISqlBlock>> body, params Expression<Action<ILoopVariableAdapter<T>>>[] mapping)
        where T : class
    Parameters
    Type Name Description
    Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>> selectQuery

    Cursor query description

    String cursorName

    Cursor name

    Expression<Func<ISqlBlockAdapter, ISqlBlock>> body

    Loop body SQL block

    Expression<Action<ILoopVariableAdapter<T>>>[] mapping

    Loop variables mapping

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T

    Cursor mapped type

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    If(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>>, FilterOperation, Expression<Func<ISqlBlockAdapter, ISqlBlock>>[])

    IF [NOT] EXISTS(...) SQL block

    Declaration
    ISqlBlock If(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> existsStructure, FilterOperation operation, params Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] parts)
    Parameters
    Type Name Description
    Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> existsStructure

    Exists select structure

    FilterOperation operation

    Comparision operation (Exists or NotExists only)

    Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] parts

    True-part SQL block and (optionally) false-part SQL block

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    If<T>(Expression<Func<ISqlValueAdapter, ISqlValue<T>>>, Expression<Func<ISqlValueAdapter, ISqlValue<T>>>, FilterOperation, Expression<Func<ISqlBlockAdapter, ISqlBlock>>[])

    IF SQL block

    Declaration
    ISqlBlock If<T>(Expression<Func<ISqlValueAdapter, ISqlValue<T>>> check, Expression<Func<ISqlValueAdapter, ISqlValue<T>>> value, FilterOperation oper, params Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] parts)
    Parameters
    Type Name Description
    Expression<Func<ISqlValueAdapter, ISqlValue<T>>> check

    SQL value to check

    Expression<Func<ISqlValueAdapter, ISqlValue<T>>> value

    SQL value to compare with check
    Can be null to describe IS NULL or NOT IS NULL comparisons

    FilterOperation oper

    Comparision operation

    Expression<Func<ISqlBlockAdapter, ISqlBlock>>[] parts

    True-part SQL block and (optionally) false-part SQL block

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Insert<TResult>(String, DataTable, Expression<Func<ISetBlockAdapter, TResult>>)

    INSERT INTO...VALUES(...),VALUES(...)... SQL block

    Declaration
    ISqlBlock Insert<TResult>(string tableName, DataTable data, Expression<Func<ISetBlockAdapter, TResult>> mapper)
        where TResult : class
    Parameters
    Type Name Description
    String tableName

    Table to insert

    DataTable data

    Data table filled by data
    Access data by Data<T>(String) method inside expressions

    Expression<Func<ISetBlockAdapter, TResult>> mapper

    Fields to insert values mapper

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    TResult
    See Also
    Data<T>(String)
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Insert<T>(String, Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>>)

    INSERT INTO... SELECT SQL block

    Declaration
    ISqlBlock Insert<T>(string tableName, Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>> selectQuery)
        where T : class
    Parameters
    Type Name Description
    String tableName

    Table to insert

    Expression<Func<IBlockQueryStructure, IBlockQueryDescription<T>>> selectQuery

    Select query description
    Use same fields order as in fields parameter

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Insert<TResult>(String, Expression<Func<ISetBlockAdapter, TResult>>)

    Single INSERT INTO...VALUES SQL block

    Declaration
    ISqlBlock Insert<TResult>(string tableName, Expression<Func<ISetBlockAdapter, TResult>> mapper)
        where TResult : class
    Parameters
    Type Name Description
    String tableName

    Table to insert

    Expression<Func<ISetBlockAdapter, TResult>> mapper

    Fields to insert values mapper

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    TResult
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Merge<T>(String, String, String, Expression<Func<IMergeBlockAdapter, T>>)

    MERGE SQL block

    Declaration
    ISqlBlock Merge<T>(string tableName, string targetAlias, string sourceAlias, Expression<Func<IMergeBlockAdapter, T>> mapper)
        where T : class
    Parameters
    Type Name Description
    String tableName

    Table name to merge with

    String targetAlias

    Target table alias

    String sourceAlias

    Data source alias

    Expression<Func<IMergeBlockAdapter, T>> mapper

    Data source mapper
    Use Link(), Update() and Insert() structure flags to set merge role of data source columns

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Merge<T, TSource>(String, String, Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TSource>>>, String, Expression<Func<IMergeBlockAdapter, T>>)

    MERGE SQL block

    Declaration
    ISqlBlock Merge<T, TSource>(string tableName, string targetAlias, Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TSource>>> sourceQuery, string sourceAlias, Expression<Func<IMergeBlockAdapter, T>> mapper)
        where T : class where TSource : class
    Parameters
    Type Name Description
    String tableName

    Table name to merge with

    String targetAlias

    Target table alias

    Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TSource>>> sourceQuery

    Source subquery description

    String sourceAlias

    Data source alias

    Expression<Func<IMergeBlockAdapter, T>> mapper

    Data source mapper
    Use Link(), Update() and Insert() structure flags to set merge role of data source columns

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T
    TSource
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    SetVar(Expression<Func<ISetSqlVarAdapter, ISqlValue>>[])

    SQL variables initialization SQL block

    Declaration
    ISqlBlock SetVar(params Expression<Func<ISetSqlVarAdapter, ISqlValue>>[] variables)
    Parameters
    Type Name Description
    Expression<Func<ISetSqlVarAdapter, ISqlValue>>[] variables

    Variable value descriptions

    Returns
    Type Description
    ISqlBlock

    SQL block description

    See Also
    Declare(Expression<Func<ISqlVariable, ISqlValue>>[])
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    SetVar<TValue>(Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TValue>>>, Expression<Func<ISqlVarAdapter, ISqlValue>>[])

    SQL variables initialization using SELECT... INTO statement SQL block

    Declaration
    ISqlBlock SetVar<TValue>(Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TValue>>> selectQuery, params Expression<Func<ISqlVarAdapter, ISqlValue>>[] variables)
    Parameters
    Type Name Description
    Expression<Func<IBlockQueryStructure, IBlockQueryDescription<TValue>>> selectQuery

    Query description used as data source

    Expression<Func<ISqlVarAdapter, ISqlValue>>[] variables

    Variable value descriptions

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    TValue
    See Also
    Declare(Expression<Func<ISqlVariable, ISqlValue>>[])
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    | Improve this Doc View Source

    Update<T>(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>>, Expression<Func<ISetBlockAdapter, T>>)

    UPDATE SQL block

    Declaration
    ISqlBlock Update<T>(Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> query, Expression<Func<ISetBlockAdapter, T>> setExpr)
        where T : class
    Parameters
    Type Name Description
    Expression<Func<IBlockQueryStructure, IBlockQueryStructure>> query

    SQL block query description

    Expression<Func<ISetBlockAdapter, T>> setExpr

    Set expression description

    Returns
    Type Description
    ISqlBlock

    SQL block description

    Type Parameters
    Name Description
    T
    See Also
    ExecuteSqlBlock(IDataScope, Expression<SqlBlockDefinition>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])
    GetSqlBlockData<T>(IDataScope, Expression<SqlBlockDefinition<T>>, Expression<Func<ISqlParamAdapter, ISqlParam>>[])

    Extension Methods

    SerializationExtensions.ToXml<T>(T)
    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>>)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX