我正在尝试使用 Utility.searchbyemail 选项检查联系人是否存在。
示例:IList myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);
上述语句引发错误:错误无法将类型“System.Collections.Generic.IList”隐式转换为“System.Collections.Generic.IList”。存在显式转换(您是否缺少演员表?)
任何帮助深表感谢。下面是我的参考代码,我希望我有所有的命名空间。
enter code here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using ConstantContactBO;
using ConstantContactUtility;
using System.Data;
using System.Data.SqlClient;
namespace WebApplication4
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ConstantContactBO.Contact c = new ConstantContactBO.Contact();
c.EmailAddress = "";
AuthenticationData authdata = new AuthenticationData();
authdata.Username = "";
authdata.Password = "";
authdata.ApiKey = "";
// get user Contact List collection
string nextChunkId;
string currentChunk;
string x = "a@abc.com";
string[] emailAddress = new string[]{x.Trim()};
IList<ContactList> lists = Utility.GetUserContactListCollection(authdata, out nextChunkId);
**IList<Contact> myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);** //Throws Error here
}
}
}