An enumerable sequence of parameters (arrays, lists, etc) is not allo
环境:dapper asp.net core
出错代码如下:
public Task<IEnumerable<dynamic>> GetList(string query, params SqlParameter[] sps)
{
var list = context.QueryAsync<dynamic>(query,sps);
return list;
}
第一次用dapper,在asp.net core webapi上,遇到的第一个问题。错误原因应该是参数不支持的问题,其实错误提示的很清楚了。
知道哪里错了,就知道怎么解决了。
参数改为object类型即可。
以下是改正过的:
public Task<IEnumerable<dynamic>> GetList(string query, object para)
{
var list = context.QueryAsync<dynamic>(query, para);
return list;
}
sqlhelper思维惯性导致的。血的教训。
An enumerable sequence of parameters (arrays, lists, etc) is not allo的更多相关文章
- Dapper full example
Skip to content Sign up Sign in This repository Explore Features Enterprise Blog Watch Star , Fork S ...
- Effective Java 25 Prefer lists to arrays
Difference Arrays Lists 1 Covariant Invariant 2 Reified at runtime Erased at run time 3 Runtime type ...
- 随机打乱工具sklearn.utils.shuffle,将原有的序列打乱,返回一个全新的错乱顺序的值
Shuffle arrays or sparse matrices in a consistent way This is a convenience alias to resample(*array ...
- Java 前端模板引擎学习:thymeleaf 模板引擎
模板引擎接口 ITemplateEngine 一.后台数据与外部数据 1.处理后台数据 $表达式是个变量表达式,用于处理在 request parameters and the request, s ...
- (转)Awesome Courses
Awesome Courses Introduction There is a lot of hidden treasure lying within university pages scatte ...
- Kaggle入门(一)——Digit Recognizer
目录 0 前言 1 简介 2 数据准备 2.1 导入数据 2.2 检查空值 2.3 正则化 Normalization 2.4 更改数据维度 Reshape 2.5 标签编码 2.6 分割交叉验证集 ...
- Spring框架文档与API(4.3.6版本)
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ Table of Contents I ...
- python之histogram
histogram A histogram is an accurate representation of the distribution of numerical data. It is an ...
- sklearn.model_selection 的train_test_split方法和参数
train_test_split是sklearn中用于划分数据集,即将原始数据集划分成测试集和训练集两部分的函数. from sklearn.model_selection import train_ ...
随机推荐
- subline 相关
ctrl + ` 输入命令: import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.insta ...
- js 遍历行和列
]; //遍历列 ; i < table.rows[].cells.length; i++) { console.log(table.rows[].cells[i].innerText); ]. ...
- ADO.Net创建数据模型和数据访问类及泛型集合
数据模型和数据访问类:数据模型: 使用面向对象中的封装特性,将数据表中的行数据组成一个同样结构的对象,来单独使用: 数据访问类: 将某一个表的全部增删改查操作的方法写进去,方便统一管理和调用: 数据模 ...
- Python列表推导式
- 人脸识别 1:1 和1:n
- lcd 控制器
1. 使用lcd 一般需要一个控制器和驱动器,控制器需要初始化以产生正确的时序,驱动器一般是和lcd基板制作在一起. LCD 控制器结构图: REGBANK 表示调色板 LCDDMA 表示DMA通道 ...
- SpringBoot @Aspect
1.添加maven依赖注解 <!--springBoot的aop--> <dependency> <groupId>org.springframework.boot ...
- zabbix 利用python脚本实现钉钉告警
Zabbix 利用python脚本实现钉钉告警 1.安装python3.6环境 2.创建python脚本 cd local/zabbix-4.0.3/share/zabbix/alertscripts ...
- dropload插件的使用(上拉下滑加载数据)
.导入 js dropload.min. js zepto.min.js <!-- jQuery1.7以上 或者 Zepto 二选一,不要同时都引用 --> $(function(){ ...
- Implementing a Dispose method
[Implementing a Dispose method] 1.实现System.IDsiposable.Dispose()方法.不能将此方法设置为virtual,子类不能override此方法. ...