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_ ...
随机推荐
- mac使用brew安装sshpass
brew安装sshpass brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Form ...
- 判断页面是否添加了W3C声明
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- java资源文件解读
[1]从零开始建工程 最简单的:http://www.cnblogs.com/alipayhutu 其中d)换作: ApplicationContext context = new ClassPath ...
- overload重载
方法的重载 /** * 重载 overload * @author Administrator *同一个类,同一个方法 *不同:参数列表不同(类型,个数,顺序) 只和 参数列表有关 * 跟 返回值 和 ...
- web前端面试题HTML/CSS部分
web前端面试题HTML/CSS部分 前端页面有哪三层构成,分别是什么?作用是什么? 1.结构层:由 HTML 或 XHTML 之类的标记语言负责创建,仅负责语义的表达.解决了页面“内容是什么”的问题 ...
- mysql 查询上个月某一天
本文地址:http://www.cnblogs.com/jying/p/8877065.html 需求:获取上个月15号的日期 网上一搜一大堆粘贴复制的大坑:(如下是查询上个月最后一天,可是我要的不一 ...
- RTX二次开发SDK需要注意的地方
1.如果是ASP.net二次开发调用的,线程池必须开发 Enable 32-bit Applications设置为true. 因为RTX的调用接口很多是32位的.否则会报一下错误 RootObj = ...
- java-学习8
方法的声明及使用 public class function { public static void main(String[] args) { printInfo();//调用printInfo( ...
- grabcut 分割 Rect
#include "opencv2/opencv.hpp" using namespace cv; void main() { Mat src = imread("E:\ ...
- springboot-day02-整合mybatis与简单使用
前言:该文章是紧接上一篇文章springboot-day01-引入如何读取配置文件以及helloWorld 1.springboot整合mybatis 1.添加jar包依赖 <?xml vers ...