Closed paulodiogo closed 4 years ago
Hi there,
I'm not entirely sure of the use case but the only way to have a Func
called when rendering is to us our Lambda functionality, the issue here is your signature doesn't match what Stubble expects. If stubble doesn't know how to render a value it will call ToString
on the value so one option if you're trying to render a template XPTO {{X}}
where X is a IParametro
is to add a ToString()
on the class which will be used in the render.
Hopefully this helps some, if not could you provide a small reproduction sample and we can try help more?
Thanks, stay safe too
That helped. I used other approach and in the end used a Dictionary<string, string>
.
Thank you! You guys made a great job here!
Hello, I have an complex and dynamic object that has a list of
IParametro
and these guys has an methodObterValor
. I am trying to render a template that is like ´XPTO {{X}}´ where X is aIParametro
.I am trying to do something like:
But the render returns: XPTO System.Func`2[LogicaPesquisa.Negocio.IParametro,System.Object]
Is it possible to pass a Dictionary<string, Func<IParametro, object>>?
Thank you! Stay safe!
I created a class like this:
this class smells =>.