With a class such as this:
C#public class Account
{
public string FirstName { get; }
public string LastName { get; }
public string Kommun { get; }
}
I expect the smart constructor template (cc) to offer to create constructor parameters to initialize these three properties.
I would of course expect the template to disregard properties with an inline initializer such as this:
C#public string FirstName { get; } = "Daniel";
But other auto-implemented readonly properties should be included. After all, there is no other way they can possible be set except through the constructor.
Hi Daniel,
Thank you for your interest in CodeRush for Roslyn.
We have a similar request from another customer: Smart Constructor - Add an ability to initialize properties.
I have marked this ticket as its duplicate. We will implement the requested functionality in the next releases and you will be informed as soon as it is implemented.
OK, thank you.
You are welcome!
Please reopen this one, as the supposed duplicate was closed today without the issue described here having been resolved.
Hi Daniel,
Thank you for the fast update.
We have already resolved this problem, and I posted an answer in the duplicated ticket (T294233).
Would you please verify that the new build works well for you?