How can I configure Entity Framework to automatically trim values?
问题 I need to make “EF Core 2.1.0” remove white space from Strings fields in queries, “HasConversion” not is not working, can you tell me why? entity.Property(e => e.Name) .HasConversion( new ValueConverter<string, string>(v => v.TrimEnd(), v => v.TrimEnd())); -using DB2 database and .net core 2.1 Query: public List<ItemServico> List() { return _uow._db.ItensServico.ToList(); } 回答1: That's what the varchar type is for, to trim spaces automatically, and efficiently. Manual trim() operations have