Skip to content

[DataMember(Name="xxxx")] is ignored when serialising. #458

@ingybing

Description

@ingybing

We have .net classes which follow a UpperCamel format for properties but the data contract we implement is a lowerCamel format. To do this we use the DataMember attributes name property to specify a lowerCamel case name for the property when serialised. This appears to be ignored when restsharp is serialising the data.

e.g.
[DataContract]
public class Wibble
{
[DataMember(name="wobble")]
public string Wobble {get;set;}
}

we would expect to see serialised as:

{wobble:""}

but instead is serialised as

{Wobble:""}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions