0

I am trying to check if a contact exists or not using the Utility.searchbyemail option.

Example: IList myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);

The above statement throws an error: Error Cannot implicitly convert type 'System.Collections.Generic.IList' to 'System.Collections.Generic.IList'. An explicit conversion exists (are you missing a cast?)

Any help is much appreciated. Below is my code for reference and I hope I have all the namespaces in place.

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
    }
}
}
user1288906
  • 419
  • 2
  • 13
  • 25

1 Answers1

0

I resolved it. The issue was with the using of namespace WebApplication4.

user1288906
  • 419
  • 2
  • 13
  • 25