Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18120

.NET: Thin 3.0: Allow arbitrary MemberInit projections in LINQ

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • platforms

    Description

      Ignite LINQ provider allows anonymous type projections:

      query.Select(emp => new {Id = emp.Key, Name = emp.Value.Name});
      

      However, it does not work with a custom class:

      query.Select(emp => new Foo {Id = emp.Key, Name = emp.Value.Name});
      

      throws exception:

      System.NotSupportedException : The expression 'new Foo() {Id = [x].Key}' (type: System.Linq.Expressions.MemberInitExpression) is not supported.
      

      Add VisitMemberInit overload to CacheQueryExpressionVisitor to support this scenario. See linked SO page for more details - there is a proposed fix as well.

      Attachments

        Issue Links

          Activity

            People

              gurustron Sergey Stronchinskiy
              ptupitsyn Pavel Tupitsyn
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m