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

.NET: Allow arbitrary MemberInit projections in LINQ

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • platforms
    • Docs Required, Release Notes Required

    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

              ptupitsyn Pavel Tupitsyn
              ptupitsyn Pavel Tupitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: