Book Image

Microsoft Dynamics AX 2012 R2 Services

Book Image

Microsoft Dynamics AX 2012 R2 Services

Overview of this book

Table of Contents (17 chapters)
Microsoft Dynamics AX 2012 R2 Services
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Key components


In the previous chapter, we discussed the key components of document services. When developing custom services, there are also a few concepts you should be familiar with, starting with attributes.

Attributes

Attributes are classes that contain data just like normal classes, but the purpose of this data is different. Attributes contain metadata that describes targets. Targets can be of different types such as classes, interfaces, methods, events, and so on.

Attributes can either be intrinsic or custom. Intrinsic attributes are part of Common Language Runtime (CLR) and are contained in the .NET framework. Custom attributes are attributes that you can create yourself.

Because attributes contain metadata, they are useful only when reflection is used. An example of this is the DataContract attribute. The service generation process uses reflection on the classes that the service class uses to determine which of these classes are data contracts.

The following code shows the usage of...