Braces before method or property

Last post 07-03-2008 10:11 AM by vinz. 4 replies.

Sort Posts:

  • Braces before method or property

    07-02-2008, 8:12 PM
    • Member
      2 point Member
    • coolzubair
    • Member since 09-12-2007, 9:54 AM
    • Posts 40

     

    if there is Braces before method or property. what does that mean.

    like this

    [Column]

    public string ContactInfo

    if possibel give some examples

    thanks

     

     

     

  • Re: Braces before method or property

    07-02-2008, 8:56 PM
    • Participant
      1,122 point Participant
    • Ganeshyb
    • Member since 11-02-2007, 4:07 AM
    • Posts 203

    That means your adding attributes so that you can have runtime logic to interpret those attributes.

    One of the attributes are [Obsolete] which is attribute that adds information to the member or class on which its is decrated.

    Take for example i want to build a sql statement out of my class i can create attributes like Column, Table , Where etc and decorate them to my class and properties and in runtime construct the sql statement based on these attributes.

    Thanks
    Ganesh


    If you find my reply help you Mark it Answered.
  • Re: Braces before method or property

    07-02-2008, 9:14 PM
    • Participant
      1,540 point Participant
    • itsumapathyk
    • Member since 05-23-2007, 1:30 PM
    • Posts 353

     

    It is an attribute.

    In Webservice , it is a webmethod.

  • Re: Braces before method or property

    07-03-2008, 9:25 AM
    • Participant
      1,214 point Participant
    • tgyoga
    • Member since 07-02-2008, 12:04 PM
    • Chennai - India
    • Posts 212

    The thing that you mention over a Method / Function as you mentioned are called 'Attributes'

    For Example,

    [Browsable(false)]
    Public Shared Sub A()

             //Some Code

    End Sub

    The [Browsable] will take care of Showing / Hiding the contents, when you say 'Go To Defenition'.

    Regards,
    Yoga
  • Re: Braces before method or property

    07-03-2008, 10:11 AM
    Answer
    • All-Star
      89,717 point All-Star
    • vinz
    • Member since 10-05-2007, 11:47 AM
    • Cebu, Philippines
    • Posts 13,546
    • TrustedFriends-MVPs

    coolzubair:

    f there is Braces before method or property. what does that mean. like this

    [Column]

    public string ContactInfo


     Its an Attribute Specification and the Column is what we called the Attribute.. refer to the following links below for more informations

    http://msdn.microsoft.com/en-us/library/aa664616(VS.71).aspx 

    http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=129 

    Vincent Maverick Durano
    SDE|Microsoft MVP - ASP/ASP.NET
Page 1 of 1 (5 items)