1
Follows the code:
Model:
public class Usuario
{
public string Campo1 { get; set; }
public string Campo2 { get; set; }
public string Campo3 { get; set; }
public string Campo4 { get; set; }
public string Campo5 { get; set; }
public string Campo6 { get; set; }
public string Campo7 { get; set; }
public string Campo8 { get; set; }
public string Campo9 { get; set; }
public string Campo10 { get; set; }
}
Controller:
var teste = new Usuario();
string texto = ""+teste.Campo1+ teste.Campo2+ etc"";
As you can see from the code above, there is an easier way without getting typed teste
? I mean, just type teste
that already fills all fields with their value. Because tomorrow I can have more than 100 fields.
Some solution?
Interesting your answer, thank you jbueno.
– Matheus Miranda