Listing E implements this logic: Listing E privateDictionary string, string GetAliasListing(Type destinationType Get all the properties that are in the/ destination opertyInfo destinationProperties tProperties Dictionary string, string aliases newDictionary string, string foreach (PropertyInfo property in destinationProperties Get the alias attributes. This is a perfect example to show the usage of attributes because the WebMethod attribute is used to extend the programming model. There is no built-in way in C# of signifying that a method should be exposed through the Web service (as there is, for example, of signifying that a method should be private so the WebMethod attribute was written. This attribute's job is to determine the aliases a property may have. This allows the property's value to be mapped into another property even if the property names don't match. This attribute accepts a series of string values to hold as the mapping names ( Listing B ).
Abstract: Provides an introduction into creating and using custom attributes in C#. Introduction. Attributes give you the ability to store additional information with. Developing custom attributes, the process of creating a custom attribute is very simple. There are just a few things you must take into account before creating the attribute: What is the purpose of the attribute?