Trimming strings globally with automapper

Recently working on an application based on a legacy database with a lot of char data types I was using automapper and needed to trim all non null strings for every model->viewModel mapping. I used the below code which trims ALL strings and also converts nulls to an empty string.

Trim all non null strings

One thought on “Trimming strings globally with automapper”

Leave a Reply

Your email address will not be published. Required fields are marked *