I want to apologize in advance for not connecting the dots to understand the big picture.
This method is a violation of DRY and has a common use 3rd party library that might normally be called like:
ThirdLibrary.DoWork(x => x.Blah....);
In trying to refactor this method I wanted this line and some others near it extracted to a separate method....but I needed to pass in the lambda and Google led me to here and here.
My difficulty is translating to my exact situation with a third party library.
The third party metadata shows it is expecting:
public IDoWork<T> DoWork(Expression<Action<T>> expression);
I'm stumbling on how to parameterize this for my method.
public void RepoDoWork(Action<ICustomerRepository> doworkrule)
{
ThirdLIbrary.DoWork(doworkrule);
}
This produces the error Argument type is not assignable to parameter type.
Thank you for your assistance in helping me understand how to pass lambdas correctly.