I am stuck with this error but not sure how to fix it.
I am trying to pass a method as a parameter to another function as an action. I have an interface which defines two methods:
//ISegment interface
void SetNodeA(in INode node);
void SetNodeB(in INode node);
Next I create a segment and I want to pass this method into another function:
ISegment segment = GetSegment();
Execute(start, segment.SetNodeA);
Execute(end, segment.SetNodeB);
My execute function looks like this:
void Execute(in EndPoint point, in Action<INode> fnc)
{
Verify(segment);
Verify(point.Node);
fnc?.Invoke(point.Node); //set the node
}
Problem is i get this error:
Argument 2: cannot convert from 'method group' to 'in Action'
Not sure what it means by method group here or how to fix it.