anmarti
anmarti

Reputation: 5143

How to make property description attribute visible in IntelliSense?

Giving this property:

 public class Data
 {
    
    [Description("DESCRIPTION"), DefaultValue("")]
    public string DESCX1{ get; set; }
  }
  Data data= new Data();

I use DESCX1 because it will be easier for me to make some type mappings by property name, but I prefer a friendly name to know which property use in the MVC View.

If I type data. how can I make the description visible in Visual Studio 2015 IntelliSense?

Upvotes: 2

Views: 2989

Answers (3)

Nirav Patel
Nirav Patel

Reputation: 530

Visual studio Provide IntelliSense for summary using triple forward slash (///). it will add summary tag above method. best commenting tool in visual studio is GhostDoc. In this tool you can add signature, commenting with input parameter and it will create short description base on your name. Click Here for GhostDoc

Upvotes: 0

Leo
Leo

Reputation: 14830

You can't. IntelliSense is not designed to deal with this attribute. On the other hand, this attribute was meant to be used by VS Designers. Things you should do,

  1. Give a relevant name to your properties...in this case Description
  2. Use summary comments...

    /// <summary>
    /// Description
    /// </summary>
    public string Description{ get; set; }
    

Upvotes: 6

Andreas Pilavakis
Andreas Pilavakis

Reputation: 223

Have you looked at something like this?

XML Documentation Comments (C# Programming Guide)

Upvotes: 1

Related Questions