执行SQL 获取一个Model 集合 List<Model>

/// <summary>
/// 获取最新的24条数据
/// </summary>
/// <returns></returns>
public List<WeldResultModel> GetListByLase24()
{
    var sql = @"SELECT TOP 24 *
                FROM [WeldResult] WITH(NOLOCK)
                ORDER BY ID DESC";
    var typeModel = typeof(WeldResultModel);
    var modelProperties = MfModelInfo.GetProperties(typeModel);
    return SqlUtility.GetExeResultToList<WeldResultModel, SqlParameter, SqlDataReader>(dbHelper, DataBaseName, sql, null, modelProperties);
}

 

posted @ 2023-12-01 23:35  baivfhpwxf  阅读(7)  评论(0编辑  收藏  举报