ASP.NET MVC Core 5 application uses Npgsql Entity Framework Core Data Provider to get data from Postgres database using Entity Framework Core. Columns in database are defined as CHAR(n) type, like
create table prpalk (
sfirmanimi char(100);
)Column types cannot changed to varchar.
Using EF commands like string nimi = ctx.Prpalks.Single().Sfirmanimi; to get data, strings in application contain also trailing spaces. How to remove trailing spaces automatically ?
Is there some event in EF Core which can used to trim all string columns when returned to application ?
I havent found such setting in EF data provider, Npgsql or Postgres database.
Column types cannot changed to varchar type due to compatibility with existing legacy application.