I had syntax like this and found it clunky, because of oh so many lines of code.
services.AddSwaggerDocument(_ => { ... });
So I decided to create a private method and invoke it from the fat-arrow statement like this.
services.AddSwaggerDocument(_ => ConfigSwag(_));
...
private ConfigSwag(SwaggerDocumentSettings settings) { ... }
It works and all's good. However, I do recall that I've seen a syntax for invoking a call that was parenthesis-less, like this.
services.AddSwaggerDocument(_ => ConfigSwag);
However, I can't remember where and I have no clue what it's called so I can't google it.
Am I just confused here or is there such a syntax? If it's the latter, what is it called and how do I need to alter the method to make it work?