WCF DataContract Attribute -
i have question [datacontract] attribute.
i have written code below: here not using [datacontract] attribute test class.
class test { [datamember] public string strproperty { get; set; } [datamemer] public string strproperty2 { get; set; } } class checktotal:iservice { public string testmethod(test obj) { return obj.strproperty+strproperty2; } } for sending data client getting values correctly.
here necessary use [datacontract] attribute test class?
if removed [datamember] test class property getting error while sending client. not getting errors if not using [datacontract] attribute.
please give me brief explanation example can understand when give attribute , when not give attribute.
thanks, satya pratap.
the datacontractserializer can deal classes not have datacontract attribute if provide default constructor. see msdn documentation more details.
Comments
Post a Comment