I have a requirement to call a 3rd party rest api using service stack and this is working fine.
But one of the rest api's requires a property called "public"
Is there an attribute I can specify to give it another name in the class but use the public name when it calls the service?
so I have this definition in the class
public string public { get; set; }
The error I get is
Member modifier 'public' must precede the member type and name
Thanks
OK I found what I needed.
I tried the Alias attribute from ServiceStack.DataAnotations.Alias but this did nothing and I am not sure what it is for?
I then found that adding a reference to System.Runtime.Serialization was needed and also adorning the class with
Now each public property needs the following attribute or it will not pass the parameter to the rest server. IN the case of the property called Public it specifies the name in the DataMember attribute constructor.
Below is an example
Chris