With C # 6 and using interpolation it was better to concatenate string with data.
As in the example.
Instead of:
var d = "19";
string.Format("{0} anos", d);
It looks much better
$"{d} anos";
But using the resource, I created a column in my database that will be fed by the user through the object.
I have an immovable object with its properties.
When performing direct interpolation as:
$"{imovel.Nome} aqui é meu imóvel";
It works perfectly.
But now I have this "{imovel.Nome} aqui é meu imóvel"
information in a column.
And through a foreach
I need it to work, does anyone have any idea how to solve it?
Ex:
var imovel = new Imovel().GetImovel(); // aqui retorna meu objeto imovel
foreach(var t in Textos){
var meuTexto = $""+ t; // aqui tem isso "{imovel.Nome} aqui é meu imóvel"
var TextoInterpolado = meuTexto; // aqui deveria formatar Casa1 aqui é meu imóvel, mas ele mostra apenas assim "{imovel.Nome} aqui é meu imóvel"
}
I do not know if it was very clear, but I want something like this: link