locked
Binding FromUri to complex object ignores DataMember Name RRS feed

  • Question

  • User-1722898638 posted

    Binding from query string using [FromUri] to a complex object ignores [DataMember] attribute with changed parameter name.

    // Call GET /method?changed_id=123
    public void GetMethod([FromUri]ExampleModel model)
    {
       // The model.Id = null
    }
    
    [DataContract]
    public class ExampleModel
    {
       [DataMember(Name = "changed_id")]
       public int? Id { get; set; }
    }
    

    BTW I do not know where to report this serious bug.

    Wednesday, May 18, 2016 9:58 AM

Answers