2

Is there anything in castle that can let me add attributes to a class on the fly?

I have a dto in a project that I want to use as a data contract in a wcf service. I'd need to add a

[DataContract]

attribute to the class and then

[DataMember]

to each of the properties.

I could just replicate the class in the service layer and then copy the list to a new list of the new type but thats a ballache. There must be something in dynamicproxy or somewhere?

w://

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275

1 Answers1

1
  1. Not out of the box
  2. WCF 3.5 or newer does not require attributes on data contracts.
Krzysztof Kozmic
  • 27,267
  • 12
  • 73
  • 115