struct system.Int32没有类型参数

时间:2014-03-03 16:44:35

标签: asp.net-mvc c#-4.0

我一直收到错误消息:

  

struct system.Int32没有类型参数

在我的界面方法中。有谁知道我做错了什么?

public class StatementRptParamId {
  public Int32 ReportParameterId { get; set; }
}


public interface IStatementRptParamId {
  Int32<StatementRptParamId> GetStatementRptParameter(string connectionString, string customerNumber);
}

此行发生错误:Int32<StatementRptParamId>...

1 个答案:

答案 0 :(得分:0)

看起来您正在尝试使用Int32作为通用,这是不正确的。看起来您认为您正在指定方法调用的返回类型,您也不需要这样做。你已经为这个名字命名了一个类型。只需将您的定义更改为:

StatementRptParamId GetStatementRptParameter(string connectionString, 
    string customerNumber);

然后,您可以使用该类中的字段来获取您的值:

var val = GetStatementRptParameter(someConnectionString, someCustomerNumber);
var id = val.ReportParameterId;
相关问题