Razor.Templating.Core
Razor.Templating.Core copied to clipboard
Why 3 overloads for RazorTemplateEngine.RenderAsync?
Hi,
I have some generic piece of code that calls RazorTemplateEngine.RenderAsync with 3 arguments. But sometimes, model or viewdata could be null. In that case I have a compiler warning. I wonder if this would not be better to have a single signature with 3 arguments where model and viewdata accept null. Otherwise, the client app has to write some "if" code, testing for null and calling the right overload. Just my 2 cents.
Hi, that's a valid concern. I'll see if we can address them in the upcoming releases(without any breaking changes). Thanks.
Hey @cadilhac, this is now implemented in https://github.com/soundaranbu/Razor.Templating.Core/releases/tag/v1.8.0-rc.1
Thanks for your valuable suggestion!