Пример #1
0
 /// <summary>
 /// Method to add an attribute to the model class
 /// </summary>
 public void AddClassAttribute(AttributeModel attribute)
 {
     if (attribute.Arguments != null && attribute.Arguments.Length != 0)
     {
         this.targetClass.CustomAttributes.Add(
             new CodeAttributeDeclaration(
                 attribute.Name,
                 attribute.GetArguments()));
     }
     else
     {
         this.targetClass.CustomAttributes.Add(new CodeAttributeDeclaration(attribute.Name));
     }
 }