Edit and delete error in FirstOrDefault() postgresql

I have created a project with Radzen and Postgresql. Edit and delete rows of the tables don't work because
var items = context.Almacens
.AsNoTracking()
.Where(i => i.refe == refe);

        var item = items.FirstOrDefault();

always returns null.

You can start the project with Visual Studio and put a breakpoint in that method to check if the refe parameter has the right value and if there is a corresponding record in the database.

Thanks,

I have done it and the refe value was correct

This is very strange. Does editing work? I mean opening the edit page and getting an item loaded in the form? It uses GetXXXById which uses similar Entity Framework code.

Thanks Atanas,

Please, see in this image the error when click in ítem for edit:

The value is a string that ends with a lot of spaces. This is probably why it doesn't match.

Yes, that was the problem.
I have solved it by adding in the entity anotation::
[Column(TypeName = "char(16)")]