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_ ...
随机推荐
- MySQL系统变量配置基础
本文出处:http://www.cnblogs.com/wy123/p/6595556.html MySQL变量的概念 个人认为可以理解成MySQL在启动或者运行过程中读取的一些参数问题,利用这些参数 ...
- Celery + RabbitMq 示意图
一直搞不清楚消息队列和任务队列是如何结合的,直到碰到了 :http://www.cnblogs.com/jijizhazha/p/8086119.html 中的图,恍然大悟,凭借自己的理解,画了这幅组 ...
- MVC part3
SpringMVC原理图 SpringMVC接口解释 DispatcherServlet接口: Spring提供的前端控制器,所有的请求都有经过它来统一分发.在DispatcherServlet将请求 ...
- 开发一个FTP软件
一.开发一个多并发的FTP server 需求: .允许同时支持多用户在线 .用户认证 .用户空间配额 .权限限制 .可上传下载.上传下载过程中显示进度条 .用户可远程切换目录.查看服务端文件列表等 ...
- C#自制Web 服务器开发:用C#开发自己的Web服务器
当输入: GET / HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: zh-CN User-Agent: ...
- 单例模式 demo
// 用单例模式实现自定义颜色类 public class MyColor { private static MyColor _redColor = null; public static MyCol ...
- Hadoop集群(四) Hadoop升级
Hadoop前面安装的集群是2.6版本,现在升级到2.7版本. 注意,这个集群上有运行Hbase,所以,升级前后,需要启停Hbase. 更多安装步骤,请参考: Hadoop集群(一) Zookeepe ...
- Python 类的魔术方法
Python中类的魔术方法 在Python中以两个下划线开头的方法,__init__.__str__.__doc__.__new__等,被称为"魔术方法"(Magic method ...
- windows的cmd下面格式化某个盘符
1.crl+R 输入cmd回车. 2.如果要格式化的是E盘,哪直接输入 在DOS窗口中输入“format f: “ ,其中:format 为格式化命令,f: 为需要格式化的分区
- Light Probe Proxy Volume
[Light Probe Proxy Volume] The Light Probe Proxy Volume (LPPV) component allows you to use more ligh ...