A binary operator with incompatible types was detected. Find operand types edm.string and edm.guid that are of equal type


Leonardo Ninninger

I implement filter using breeze predicate. Using BreezeJs and ASP.NET WebAPI (Breeze server side) with Entity Framework

The predicate looks like this:

var predicate = breezeProvider.breeze.Predicate.create('serialNumber', '==', $scope.filter.serialNumber);
predicates.push(predicate);

when I execute the query. Breeze throws an exception with the following message:

A binary operator with incompatible types was detected. Find operand types edm.string and edm.guid that are of equal type

$scope.filter.serialNumber is a string and serialNumber is a GUID property

The URL is as follows.

http:// localhost:51969 / breeze / WarehouseProductTransactions / GetProducts吗? 883c-2c841771a3e8')&$ orderby = Id&$ top = 5&$ expand = Inventory,AuthorizedADUser&$ inlinecount = allpages&)

Note the following code snippet:

(SerialNumber eq guid'1b9d065e-eb48-4f3d-883c-2c841771a3e8')

My server side is as follows:

[EnableBreezeQuery(MaxNodeCount = 200)]
public IQueryable<WarehouseProductTransactionDetail> GetProducts()
{
    return _contextProvider.Context.WarehouseProductTransactionDetails;
}

I'm trying to figure out how to fix this situation, but have no idea.

Any help is appreciated

Jixin joy

Had the same problem when comparing userId in Breeze query. Breeze appends 'guid' to the OData query.

I was able to fix this by appending .toType("entityTypeName")to the breeze query .

let query = new breeze.EntityQuery().from('orders');          
let predicate = breeze.Predicate.create("CreatedBy", "==", userId);


query = query.where(predicate).toType("Order");

Related


Operand Types of Binary AND Operator

username Which type of operator uses the logical AND operator (&)? I need to input AND shorts aand a "number" mfrom 1 to 16 and get another short b. That primitive type must be m? example: ? m = ...; //with 1 <= m <= 16 short a = 2; short b = a & m; The examp

Operand Types of Binary AND Operator

username Which type of operator uses the logical AND operator (&)? I need to input AND shorts aand a "number" mfrom 1 to 16 and get another short b. That primitive type must be m? example: ? m = ...; //with 1 <= m <= 16 short a = 2; short b = a & m; The examp

How to find the mapping of OData edm model types to clr types?

Wiczynski My data layer does not expose IQueryable. I still want to be able to sort the data. My API has this functionality, but I need to determine what needs to be sorted. Say I have a model configured like: ODataModelBuilder modelBuilder = new ODataConventi