One solution would be to have a simple constructor and use the property initializer syntax that came with . NET 3.0
Your code would have an empty constructor with only one or two parameters and the other properties would be initialized separately during construction:
Pessoa pessoa = new Pessoa() {
Nome = "nome",
Sobrenome = "sobrenome",
Idade = 33,
Profissao = "programador",
Salario = 10000.50,
DtNascimento = new DateTime(12,12,1912)
};
This way Intellisense will complete all the bootable properties inside the keys and when it puts comma and the programmer can initialize as many as you want without having to pass null or empty string to those parameters that you do not have at the moment.
It is not good practice to use a very large list of arguments, your code is difficult to maintain. Have you considered passing a simpler object containing the properties you want to define in your constructor and then treating them in the constructor instead of a huge list of arguments? But it’s just a suggestion.
– Gabriel Gartz
@Gabrielgartz but he is passing person data.. create another class just to pass... one person as parameter of the other? Even using DTO this gets weird :p
– MayogaX
It’s been a while since I used dotnet. When I used I had the Resharper in my Visual Studio, it makes many improvements to the ide. Now I honestly don’t know if it solves your problem, you can take a look at at this link and see if there’s anything that solves.
– Edgar Muniz Berlinck