NpgsqlTsVector doesn't work using EF In Memory Database

73 Views Asked by At

I have a NpgsqlTsVector attribute in my C# class:

public NpgsqlTsVector Pesquisa { get; set; }

I'm using it for searching in the database. It works using the real database.

The problem is in my test class, I'm using Microsoft.EntityFrameworkCore.InMemory package and getting the following error:

System.InvalidOperationException : The 'NpgsqlTsVector' property 'Produto.Pesquisa' could not be mapped because the database provider does not support this type. Consider converting the property value to a type supported by the database using a value converter. See https://aka.ms/efcore-docs-value-converters for more information.
Alternately, exclude the property from the model using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

I already tried to ignore this field in OnModelCreating, but doing this, the search also doesn't work in the real database.

0

There are 0 best solutions below