Consider adding conversion logic into a generated Project query for Aggregate when it's necessary

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.14.0
    • Affects Version/s: None
    • Component/s: LINQ, LINQ3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This ticket is related to the user's question in CSHARP-2908.

      Currently, this projection logic:

      var resultProject = collection
      .Aggregate()
      .Project(
      	el => new { DividedPopulation = ((el.Population / 23))            
      })
      .ToList();
      

      will fail with FormatException, because we're trying to convert a double field from server response to int. We need to consider a convert top-level json node to the generated request, for example, to something like this (added `$toInt`):

      { $toInt : { $divide : [ ... ] } }
      

      It's possible that this ticket will be implemented in the scope of LINQ redesign ticket CSHARP-2608

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

              Created:
              Updated:
              Resolved: