<HttpGet()>
Public Function Search(<FromUri()> ByVal name As Name) As HttpResponseMessage
// get params from complex type
// or check for model validation
name.firstName;
name.lastName;
End Function
Public Class Name
<Required()>
Public firstName As String
<Required()>
Public lastName As String
End Class
/api/abc/search?firstName=jack&lastName=daniels
I am trying to send a comlex type as a query parameter but name is always null even though I am using fromUri attribute. What am I missing?
EDIT: I am also using Required() attribute from System.ComponentModel.DataAnnotations .