Skip to content

Join with int list #122

@frankiDotNet

Description

@frankiDotNet

I am trying to inner join on a int list but it does not work:

public class Person
      {
         public int Id { get; set; }
         public String Name { get; set; }
         public String FirstName { get; set; }
         public Int32 Status { get; set; }
      }
// This works
// query is a list of persons..
var idList = new List<int>() {1, 2, 3, 4};
var dynamicQuery = query
                .Join(
                    idList , x => x.Id, y => y, (left, right) => new {left, right});

The dynamic expression does not work, I don`t know if it is the syntax, but I am getting a System.TypeInitializationException:

var dynamicQuery = query
            .Join(
                idList, "it.Id", "it", "new (outer as card, inner as ids)");

var dynamicQuery = query
            .Join(
                idList, "it.Id", "i => i", "new (outer as card, inner as ids)");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions