I have a wcf service which has a method as follow:
public void SyncClient(List<Client> client)
{
}
then i call this in a lib solution which has reference to this service as follow:
WCF.SyncClient wcfSer = new WCF.SyncClient();
List<Client> clientModified = secondservice.Get_Clients(ModifiedDate, modifiedUnt).ToList();
wcfSer.SyncClient(clientModified);
but I keep on getting the following error :
The best overloaded method match for 'SyncClient(SyncLib.ClientWCF.Client[])' has some invalid arguments
cannot convert from 'System.Collections.Generic.List<SyncLib.Client>' to 'SyncLib.WCF.Client[]'
The only thing I am doing is getting the list populated with another web service.
what is the problem here as the argument that I am passing is list and the method accepts list, can some one please point me to right direction.
This is down to how you added the service reference.
You can either amend your code to send client[]
or re-add the reference and select the option to use System.Collection.Generic.List as below;
Select Collection Type as
System.Collection.Generic.List