Hi,
Attribute are used in C# and X++ what is the difference.
Regards,
*This post is locked for comments
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
To read more on Dynamics AX Attributes you can look at: msdn.microsoft.com/.../gg846588.aspx
Thank you...!
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Tocauer 4
Community Member 4
Nayyar Siddiqi 2