Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following code but I would like invoke
Select(GetID(with parameters).

 double GetID(ID id)
{
 
double mId;
mId = id.getId(1, '0', 0, 10000);

return mId;
}
 maxID = dataFile.PaternMatching(objId).Select(GetID).Max();

I would like have the following instead

 double GetID(ID id, , int a, char c, int b, int d)
 {

double mId;
mId = id.getId(a, c, b, d);
return mId;

}

 maxID = dataFile.PaternMatching(objId).Select(GetID(1, '0', 0, 10000)).Max();


What I have tried:

 double GetID(ID id, , int a, char c, int b, int d)
 {

double mId;
mId = id.getId(a, c, b, d);
return mId;

}

 maxID = dataFile.PaternMatching(objId).Select(GetID(1, '0', 0, 10000)).Max();
Posted
Updated 8-Jun-20 2:05am

1 solution

Your question isn't entirely clear, but I think you're looking for a lambda method:
C#
maxID = dataFile.PaternMatching(objId).Select(id => GetID(id, 1, '0', 0, 10000)).Max();
Lambda expressions - C# Programming Guide | Microsoft Docs[^]
 
Share this answer
 
Comments
merh 8-Jun-20 10:18am    
Yes, thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900