Unable to call ToString on Projections

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.9.3
    • Affects Version/s: 2.9.1
    • Component/s: LINQ
    • None
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      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(), }}
      {{ });}}

              Assignee:
              Dmitry Lukyanov (Inactive)
              Reporter:
              Jake Sta Teresa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: