I'm new to odata and WebApi. I'm trying to send the following odata query: ?$filter=ExternalIds eq '5'
ExternalIds is part of an object and define as:
public Id ExternalIds { get; set; }public class Id { [DataMember] public string Name { get; set; } [DataMember] public string Value { get; set; } }
i'm getting the error: "A binary operator with incompatible types was detected. Found operand types 'GenericAPIInterface.Entities.User.Id' and 'Edm.String' for operator kind 'Equal'."
In order to use the property values on a related class you will need to use the navigation syntax within
$filter
, e.g....?$filter=ExternalIds/Value eq '5'
. Also, ifExternalIds
is an entity (has it's own id), you may want to expand it using$expand
. This is not strictly necessary for the filter clause to work, however.