I have a web service that looks like this
[WebMethod]
public int Import(System.Collections.Generic.List<Record> importRecords)
{
int count = 0;
if (importRecords != null && importRecords.Count > 1)
{
DataLayer datalayer = new DataLayer();
foreach (Record brec in importRecords)
if (rec != null)
{
datalayer.InsertUpdateRecord(rec);
count++;
}
}
return count;
}
And i have a client software that wants to send data to the web service using this method
ImportService.BVRImportService importService = new ImportService.ImportService();
ImportService.Record myRecord = new ImportService.Record();
myRecord.FirstName = "Adam";
System.Collections.Generic.List<ImportService.Record> myRecords =
new List<ImportService.Record>();
myRecords.Add(myRecord);
importService.ImportData(myRecords);
I keep getting this message when I try to compile the client software.
Error 1 The best overloaded method match for 'ImportTask.ImportService.ImportService.ImportData(ImportTask.ImportService.Record[])' has some invalid arguments
Error 2 Argument '1': cannot convert from 'System.Collections.Generic.List<ImportTask.ImportService.Record>' to 'ImportTask.ImportService.BVRRecord[]'
Does anyone know what i'm doing wrong?