Ticket T258677
Visible to All Users

The "Throw exceptions" contract does not use the new "nameof" feature

created 10 years ago

When adding a throw exceptions contract for an item the template still embeds the name of the item as a string instead of using the new nameof feature.

Also the error strings in the other contract types have the item embedded in them. This would be a good place to use string interpolation.

Comments (1)
DevExpress Support Team 10 years ago

    Hi Cameron,

    Thank you for your report. We have discussed your note and completely agree with you that these changes make sense in the latest C# and Visual Basic versions. I have passed this thread to our developers so they can introduce these changes.

    Answers approved by DevExpress Support

    created 10 years ago

    We have implemented the functionality described in this ticket. It will be included in our next update(s).

    Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

      Comments (2)
      CM CM
      Cameron MacFarland 10 years ago

        1.0.4 now uses nameof, which is nice, but the message string still contains the item name as a string. For example:
        throw new ArgumentNullException(nameof(item), "item is null.");
        could become this:
        throw new ArgumentNullException(nameof(item), $"{nameof(item)} is null.");

        DevExpress Support Team 10 years ago

          Hi, I created a new ticket on your behalf ("Throw Exception" Contract should use the "nameof" syntax within the exception message string). You are welcome to continue the discussion of this problem within that thread.

          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.