Modeling C# attributes which can be applied multiple times

This content applies to version 7.5.1 or later. In C#, attributes can be applied multiple times to a method, such as the FaultContract attribute. When modeling a Windows Communication Foundation (WCF) library, the «FaultContract» stereotype can be applied only once to a UML operation, however, additional applied attributes can still be captured in the model.

Before you begin

The C# and .Net WCF profiles must be applied to the model before you can use the stereotypes in this procedure.

About this task

To apply multiple attributes to an operation in the model:

Procedure

  1. On a UML operation with the «CSharp Method» stereotype, apply the initial attribute stereotype to the UML operation. For example, apply the «FaultContract» stereotype.
  2. To add additional FaultContract attributes, type the attribute string in the Attributes property of the «CSharp Method» stereotype.

Feedback