SqlHelperAllT Method

全部查詢

Definition

Namespace: eBizprise.Framework
Assembly: eBizprise.Framework.Database.SqlHelper (in eBizprise.Framework.Database.SqlHelper.dll) Version: 25.0.2.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
C#
public DatabaseResult<IEnumerable<T>> All<T>()

Type Parameters

T
物件類型

Return Value

DatabaseResultIEnumerableT
DatabaseResult<IEnumerable<T>>

Implements

IDatabaseHelperAllT

Example

C#
using (SqlHelper sqlHelper = new SqlHelper("SqlServer"))
{
    DatabaseResult<IEnumerable<Employee>> result = sqlHelper.All<Employee>();

    if (result.IsSuccess) {
        IEnumerable<Employee> employees = result.Result;

        //Do something
    } else {
        Exception exception = result.Exception;

        //Error handling
    }
}

Revision History

DateVersionDescription
2020/02/071.0.0.0初版
2020/02/191.0.0.1調整回傳格式包含執行成功與否以及異常訊息
2020/03/061.0.2.0增加支援結構描述
2020/09/011.0.18.0增加Log明細
2025/08/081.0.1.0修正含ExtendJson資料查詢會變空值問題
2025/09/1925.0.0.0彙整2025年度初版

See Also