How can I write the lambda expression in optionObject.Forms.First(f => f.FormId == formId).MultipleIteration
to a Func so at the end I have something like
Func<FormObject, bool> FormID = f => f.formID == passedVal;
and then use it on the first expression to get something like
optionObject.Forms.First(FormID).MultipleIteration
I tried
Func<FormObject, PassedVal, bool> FormID => formID == PassedVal;
but did not work.
Please note that there is nothing wrong with the lambda expression, it works fine. I am just trying to create a function to replace the expression with the name of the function to make the code look shorter and maintainable.