user9062238
user9062238

Reputation:

How can i pass parameter to this method

This is the method:

getUsersList(ref List<RealBioSDKUser> userList, 
             int groupId = -1, 
             [DateTimeConstant(0), Optional] DateTime fromDate)

When I pass the parameters like this :

List<RealBioSDKUser> tempUserList=new List<RealBioSDKUser>();
BioClient.getUsersList(ref tempUserList,0, "1900-01-01");

is shows this error:

the best overloaded method match for collections.generic.list like this.

Upvotes: 1

Views: 60

Answers (2)

Dmitrii Bychenko
Dmitrii Bychenko

Reputation: 186668

When invoking, provide DateTime (i.e. new DateTime(1900, 1, 1)) instance, not String ("1900-01-01") one:

getUsersList(ref List<RealBioSDKUser> userList, 
             int groupId = -1, 
            [DateTimeConstant(0), Optional] DateTime fromDate) // <- DateTime


... 

List<RealBioSDKUser> tempUserList = new List<RealBioSDKUser>();

BioClient.getUsersList(ref tempUserList, 0, new DateTime(1900, 1, 1)); // <- DateTime

Upvotes: 3

David
David

Reputation: 218798

Because "1900-01-01" is a string, not a DateTime. Pass a DateTime object instead:

BioClient.getUsersList(ref tempUserList,0, new DateTime(1900, 1, 1));

Upvotes: 4

Related Questions