0
public object Execute(UpdateUserStatusMessage message)
{

    IList<UserPreferredAccount> CustomerList = null;

    var query = CPSession.CreateSQLQuery("exec CP.CP_USR_CNTCT_CSTMR_SELECT :userId ");
    query.SetInt32("userId", message.CpUserCntctId);
    query.SetResultTransformer(Transformers.AliasToBean(typeof(UserPreferredAccount)));

    var model = new UpdateUserStatusModel
      {
        UserId = message.CpUserCntctId,
        UserPreferredAccounts =  query.List<UserPreferredAccount>
      };

  return model;
}

这是更新用户状态模型:

    public class UpdateUserStatusModel{
        public int UserId {set; get;}
        public IList<UserPreferredAccount> UserPreferredAccounts{set; get;}
}

它给了我标题中描述的错误,我认为它们都是同一类型。

4

1 回答 1

2

您需要括号并且没有分号:

UserPreferredAccounts =  query.List<UserPreferredAccount>()
于 2013-07-30T13:15:55.940 回答