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;
}

Here is the UpdateUserStatusModel:

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

It gives me the error as described in title, I think both of them are the same type tho.

4

1 に答える 1

2

括弧が必要で、セミコロンは必要ありません:

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