web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Attributes C# vs X++

(0) ShareShare
ReportReport
Posted on by

Hi,

Attribute are used in C# and X++ what is the difference.

Regards,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at
    RE: Attributes C# vs X++

    Hi Riyaz,

    Attributes's concept is same in both C# and X++.

    “Attribute is nothing but a piece of information”.

    This information can be attached to your method, class, namespace, assembly etc. Attributes are part of your code this makes developers life easier as he can see the information right upfront in the code while he is calling the method or accessing the class and take actions accordingly.

    For instance below is a simple class where “Method1” is decorated by the “Obsolete” attribute. Attributes are defined by using the “[]“ symbol. So when developers starting coding in this class they are alerted that“Method1” is obsolete and code should be now written in “NewMethod1”.

    public class Class1

    {

           [Obsolete]

           public void Method1()

           {

           }

           public void NewMethod1()

           {

           }

    }

    For X++ attributes you can a look on this example which is actually implemented in upgrade scripts.

    axdaily.blogspot.com.au/.../x-attributes.html

  • Suggested answer
    Iulian Cordobin Profile Picture
    8,201 on at
    RE: Attributes C# vs X++

    To read more on Dynamics AX Attributes you can look at: msdn.microsoft.com/.../gg846588.aspx

  • Community Member Profile Picture
    on at
    RE: Attributes C# vs X++

    Thank you...!

  • Faisal Fareed Profile Picture
    10,796 User Group Leader on at
    RE: Attributes C# vs X++

    If it helps you please verify it

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#1
Community Member Profile Picture

Community Member 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans