'operator does not exist: json = json ef core

I am using efcore 5+ and Postgresql in my project , I have json property in my dataset as

    [Column("servicesIncluded", TypeName ="json")]
    public object ServicesIncluded { get; set; }

When I try to compare this value in join with some other table like:

         var query = await (from costItemTemplate in _shipContext.CostItemTemplates
                           join itemDetails in _shipContext.CostTemplateDetails
                           on costItemTemplate.TemplateId equals itemDetails.CostItemTemplateId
                           where costItemTemplate.ShipmentType == quote.ShipmentType &&
                                 costItemTemplate.TemplatePort.Contains(quote.FromLocation) &&
                                 costItemTemplate.ServicesIncluded == quote.AdditionalService
                           select itemDetails).ToListAsync();

I get Error that operator does not exist: json = json

Npgsql.PostgresException (0x80004005): 42883: operator does not exist: json = json

I have tried to Serialize objects in ef core LINQ query but again that serialization is not supported in db .

Is there any way to compare these both (objects/json) columns?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source