Beispiel #1
0
        public async Task <RProduct[]> SearchByCodeAndName(string keyword, EnumDefine.ProductStatus status, RefSqlPaging sqlPaging)
        {
            var datas = await WithConnection(async (connection) =>
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@Keyword", keyword, DbType.String);
                parameters.Add("@Status", status.AsEnumToInt(), DbType.Int32);
                parameters.Add("@OFFSET", sqlPaging.OffSet, DbType.String);
                parameters.Add("@FETCH", sqlPaging.PageSize, DbType.String);
                return(await connection.QueryAsync <RProduct>(ProcName.Product_SearchByCodeOrName, parameters, commandType: CommandType.StoredProcedure));
            });

            return(datas.ToArray());
        }
 public async Task <RProduct[]> SearchByCodeAndName(string keyword, EnumDefine.ProductStatus status, RefSqlPaging sqlPaging)
 {
     return(await _productRepository.SearchByCodeAndName(keyword, status, sqlPaging));
 }