title: Npgsql.PostgresException (0x80004005): 42883: operator does not exist: jsonb #> text
body: <p>I have the following SQL query: </p>
  
  <pre><code>select distinct "Customers"."CustomerId"        as "CustomerId",
                  "Customers"."FcmRegistrationId" as "FcmRegistrationId",
                  "Customers"."FCMServerKey"      as "FCMServerKey",
                  "Customers"."AppId"             as "AppId"
  from "CustomerEvents"
           inner join "Customers" on "CustomerEvents"."CustomerId" = "Customers"."CustomerId"
  where  "Customers"."AdvertiserId" = 16 and "Data" #&gt; '{inner_id}' = '4249699';
  </code></pre>
  
  <p>It works nice in my SQL-editor-client (DataGrip). But when I use it with <code>C#</code> and I have the error from the title of this question. </p>
  
  <blockquote>
    <p>Npgsql.PostgresException (0x80004005): 42883: operator does not exist: jsonb #> text</p>
  </blockquote>
  
  <p>I will show you my code: </p>
  
  <pre><code>public class PartnerApiServices : IPartnerApiService
  {
      private readonly ApplicationDbContext _applicationDbContext;
  
      public PartnerApiServices(ApplicationDbContext applicationDbContext)
      {
          _applicationDbContext = applicationDbContext;
      }
  
      public IQueryable&lt;CustomerForPartnerApiServiceModel&gt; GetCustomerBySearchField(Advertiser advertiser, string searchValue)
      {
          var rawSql = @"
              select distinct ""Customers"".""CustomerId""        as ""CustomerId"",
                              ""Customers"".""FcmRegistrationId"" as ""FcmRegistrationId"",
                              ""Customers"".""FCMServerKey""      as ""FCMServerKey"",
                              ""Customers"".""AppId""             as ""AppId""
              from ""CustomerEvents""
                       inner join ""Customers"" on ""CustomerEvents"".""CustomerId"" = ""Customers"".""CustomerId""
              where  ""Customers"".""AdvertiserId"" = @AdvertiserId and ""Data"" #&gt; @SearchField = @SearchValue"; 
  
          var res = _applicationDbContext.BySearchFieldCustomerApiModels.FromSql(rawSql,
              new NpgsqlParameter("SearchField", advertiser.SearchField),
              new NpgsqlParameter("SearchValue", searchValue),
              new NpgsqlParameter&lt;int&gt;("AdvertiserId", advertiser.AdvertiserId));
  
          return res;
      }
  }
  </code></pre>
  
  <p>Any ideas how I can pass <code>SearchField</code> and <code>SearchValue</code> correctly? </p>