【发布时间】:2017-02-14 08:17:16
【问题描述】:
假设我在数据库中有一个用户定义的数据类型:
MySuperType 其中有两个 bigint 属性(Id + Code)
我有一个接受这些参数的存储过程:
@MySuperType, @Price, @dateModified, etc...
现在在我的代码中,我像这样使用 Dapper:
using (var connecion = new SqlConnection(_connectionString))
{
result = connection.Execute("SP_name",
new {mySuperType, price, date},
commandType: CommandType.StoredProcedure);
}
但我总是收到错误
类型操作数冲突:Dapper 无法将用户定义类型:MySuperType 从参数映射到存储过程。
更改存储过程或替换用户定义类型不是一种选择
有谁知道我可以做些什么来映射类型并将参数(所有参数)发送到存储过程?
【问题讨论】:
标签: c# asp.net sql-server dapper