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_ ...
随机推荐
- LeetCode OJ 56. Merge Intervals
题目 Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6], ...
- 今天学习到的几条shell技巧
1.获取某个进程的进程号 PID=`ps aux | grep 进程名 | grep -v "grep" | awk '{print $2}'` 2.获取某个进程的CPU(同理可获 ...
- 为tomcat配置项目必须的引擎文件
1.如下图所示,红框圈出来的四个语音引擎文件是直接放在项目根目录下的,这样的话我们发布web应用的时候,项目并不能自动把这几个文件打包到tomcat中, 除非放到WebRoot文件夹下,但是这样的话项 ...
- web前端基础知识!
[HTML文档的基本结构和语法][基本结构]: <HTML> HTML 文件开始 <HEAD> HTML 文件的头部开始 <title> 网页的标题</tit ...
- shiro 密码的MD5盐值加密
- 吴裕雄 python神经网络(7)
import numpy as npnp.random.randint(0,49,3) # -*- coding:utf-8 -*-import kerasfrom keras.models impo ...
- 前往央都之行-gdufe1529
前往央都之行 Time Limit: 2000/1000ms (Java/Others) Problem Description: 刀光哥桐人和尤吉欧两人为了拯救爱丽丝,同时从卢利特村出发要尽快同时赶 ...
- SPSS-因子分析
因子分析 有可能用较少的综合指标分析存在于各变量中的各类信息,而各综合指标之间彼此是不相关的,代表各类信息的综合指标称为因子.定义:因子分析就是用少数几个因子来描述许多指标或因素之间的联系,以较少几个 ...
- webstocket 聊天
/** * 初始化socket **/ function initSocket(index_host){//端口号 if( !window.WebSocket ){ console.log(" ...
- Java字节流Stream的使用,创建方法
首先:FileOutputStream写入数据文件 学习父类的方法 使用子类的对象 步骤: 1:子类中的构造方法 作用 :绑定输出的目的地 FileOutputStream fos= new F ...