Book a Demo

Author Topic: How to decorate with .NET WCF Attributes  (Read 2723 times)

eAndy

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
How to decorate with .NET WCF Attributes
« on: September 24, 2008, 09:33:43 pm »
I want to declare a class and decorate with WCF attributes. Can I do this from inside EA?

I can see that if I reverse the code and regenerate the attributes remain but I haven't found where in EA I can see them (other than view code).

For example, I want to decorate both the class and the methods as shown below. If i decorate, reverse and re-gen they remain.

I'd like to know how to do the decoration in EA. Right now I have to define class, generate, pop to VS.NET and decorate, reverse, tweak futher and keep iterating.

      [Serializable]
      [DataContract(Namespace = "http://MyComp.com/Accounts")]
      [KnownType(typeof(ComplexAccount))]
      [KnownType(typeof(SimpleAccount))]
      public class CommonAccount : BaseAccount
      {

            public CommonAccount(){}


            [DataMember]
            public long ID (get; set;)

            [DataMember]
            public string Name (get; set;)
      }

Thank you
Andy

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to decorate with .NET WCF Attributes
« Reply #1 on: September 25, 2008, 01:25:13 am »
I think they - .Net attributes in general - are kept in tagged values, but I'm not absolutely sure. They are documented, but somewhat obscure. Take a look using the Tagged Values window (see the View menu). If they are not there, search the forum for .Net and attributes.
No, you can't have it!