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思维惯性导致的。血的教训。

时间: 2024-11-03 03:26:45

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 390 Star 2,538 Fork 844 StackExchange/dapper-dot-net branch: master dapper-dot-net/Tests/Tests.cs @mgravellmgravell 5 days ago SO30435185; make it clearer if the c

C++:[STL]详解STL之sequence container的操作及使用(vector)

1.引入 STL,即 standard tempalate library,标准模板库,是C++的重要组成部分.C++ STL(标准模板库)是一套功能强大的 C++ 模板类,提供了通用的模板类和函数,这些模板类和函数可以实现多种流行和常用的算法和数据结构,如向量.链表.队列.栈. STL的构成: 组成部分 描述 iterator(迭代器) 迭代器用于遍历对象集合的元素. container(容器) 容器是用来管理某一类对象的集合. Generic algorithm(泛型算法) 算法作用于容器.

Spring框架文档与API(4.3.6版本)

http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ Table of Contents I. Overview of Spring Framework 1. Getting Started with Spring 2. Introduction to the Spring Framework 2.1. Dependency Injection and Inversion of Contr

随机打乱工具sklearn.utils.shuffle,将原有的序列打乱,返回一个全新的错乱顺序的值

Shuffle arrays or sparse matrices in a consistent way This is a convenience alias to resample(*arrays, replace=False) to do random permutations of the collections. Parameters: *arrays : sequence of indexable data-structures Indexable data-structures

JVMS Specification(3)-The class File Format

Subsections 3 The class File Format 3.1 The ClassFile Structure 3.2 The Internal Form of Names 3.2.1 Binary Class and Interface Names 3.2.2 Unqualified Names 3.3 Descriptors and Signatures 3.3.1 Grammar Notation 3.3.2 Field Descriptors 3.3.3 Method D

(转)Awesome Courses

Awesome Courses  Introduction There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lect

2HQL及自增主键

1HQL Hibernate Query Language是一种面向对象的查询语言,HQL的操作对象时类,实例,属性:与EJB3 QL很接近. HQL的功能非常丰富,where子句后支持的运算符异常丰富,不仅包括SQL的运算符,还包括EJB-QL的运算符等. 除了Java类与属性的名称外,查询语句对大小些并不敏感. HQL 不支持union联合查询. select子句 select子句用于确定选择出的属性,当然select选择的属性必须是from后持久化类包含的属性.例如: select p.n

std::vector

Vector Vectors are sequence containers representing arrays that can change in size. Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers

STL vector的介绍(1)

尝试下翻译STL里面的一些容易和算法.四级过了,六级刚考.顺便练练自己的英语水平,翻译的不好的地方请大神多多指教哈,方便我改正. 原来均来自:http://www.cplusplus.com/ template < class T, class Alloc = allocator<T> > class vector; // generic template Vector Vectors are sequence containers representing arrays that