I am trying to perform a query like the one below. Note that p.Date and p.Decimal are of type DateTime and decimal respectively. Calling ToString on the decimal value results in an exception whereas calling ToString on a DateTime value succeeds.
var query = repository
{{ .GetQueryable()}}
{{ .Where(p => p.Id == request.Id)}}
{{ .Select(p => new Projection}}
{{ { }}
{{ Date = p.Date, }}
{{ DateAsString = p.Date.ToString("%d/%m/%Y"),}}
{{ Decimal = p.Decimal,}}
{{ DecimalAsString = p.Decimal.ToString(), }}
{{ });}}