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_ ...
随机推荐
- React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
昨天在项目中,重新封装组件时,引用了原来的一个子组件,但发现子组件在其他页面正常,在新的组件里面就发生保存, 然后把子组件注释,随便显示其div元素也正常,纠结了很久,最后发现引用的方式有问题 子组件 ...
- 吴裕雄 20-MySQL NULL 值处理
MySQL NULL 值处理我们已经知道 MySQL 使用 SQL SELECT 命令及 WHERE 子句来读取数据表中的数据,但是当提供的查询条件字段为 NULL 时,该命令可能就无法正常工作.为了 ...
- 吴裕雄 10-MySQL插入数据
语法以下为向MySQL数据表插入数据通用的 INSERT INTO SQL语法:INSERT INTO table_name ( field1, field2,...fieldN ) VALUES ( ...
- 求1到n,n个整数的全排列
package com.dong.harder; public class AllArrays { public static void main(String[] args) { // TODO A ...
- web前端面试题整理
1.在浏览器解析原理?2.ES5 的Object.defineProperties3.css3新属性的优势?4.vue 的computed和method的区别5.html5 的十个新特性6.web s ...
- maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test
mvn package的时候报如下错误: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test ...
- 联想电脑 Wifi开关开不了
"VirtualBox Host-Only Network" 没有有效的IP配置 未修复 自己电脑显示 控制面板>网络和Internet>网络连接 VirtualBo ...
- Spark Streaming之五:Window窗体相关操作
SparkStreaming之window滑动窗口应用,Spark Streaming提供了滑动窗口操作的支持,从而让我们可以对一个滑动窗口内的数据执行计算操作.每次掉落在窗口内的RDD的数据,会被聚 ...
- javascript学习笔记(八):浏览器对象
window对象 <!DOCTYPE html> <html> <head lang="en"> <meta chaset="U ...
- 830. Positions of Large Groups
In a string S of lowercase letters, these letters form consecutive groups of the same character. For ...