【发布时间】:2014-11-13 08:10:20
【问题描述】:
我有这个电话:
public IObservable<T> Subscribe(object topic, string service, string connectionString, string query)
{
try
{
this.connection.ConnectionString = connectionString;
this.connection.Open();
this.connection.Query<T>(query, new { transactionid = topic }).ToObservable().Subscribe(message => this.subject.OnNext(message));
return this.subject;
}
catch (Exception e)
{
this.subject.OnError(e);
return this.subject;
}
finally
{
this.subject.OnCompleted();
this.connection.Close();
}
}
这是我的查询:
with IDS as (select L1_ID, L2_ID, L1_VALUE, L2_VALUE
from MYDB where MYDB.ID = :transactionid)
select * from
(select L1_ID as ID, round(L1_VALUE, 28) as VALUE from IDS
union
select L2_ID as ID, round(L2_VALUE, 28) as VALUE from IDS) UN
这会抛出这个错误:
一个无参数的默认构造函数或一个匹配的签名 (System.String ID, System.Decimal VALUE) 是必需的 System.Tuple
2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Nullable1[[System.Decimal, mscorlib,版本=4.0.0.0,文化=中性, PublicKeyToken=b77a5c561934e089]],mscorlib,版本=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] 物化
【问题讨论】:
标签: c# generics tuples nullable dapper