Ticket T315236
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Smart Constructor - Add an ability to initialize properties

Smart constructor template does not consider readonly auto-implemented properties

created 9 years ago

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.

Show previous comments (2)
DevExpress Support Team 9 years ago

    You are welcome!

    DR DR
    Daniel Rosenberg 9 years ago

      Please reopen this one, as the supposed duplicate was closed today without the issue described here having been resolved.

      DevExpress Support Team 9 years ago

        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?

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.