Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectMany() not fond #158

Open
cuiliang opened this issue May 9, 2024 · 3 comments
Open

SelectMany() not fond #158

cuiliang opened this issue May 9, 2024 · 3 comments
Assignees

Comments

@cuiliang
Copy link

cuiliang commented May 9, 2024

code:

var dictList = new List<Dictionary<string, string>>
{
    new Dictionary<string, string>()
    {
        {"key1", "value1"},
        {"key2", "value2"}
    },
    new Dictionary<string, string>()
    {
        {"key3", "value3"},
        {"key4", "value4"}
    }
};


var mergedDict = dictList
	.SelectMany(d => d)
	.ToDictionary(kv => kv.Key, kv => kv.Value);

error:
Oops! No applicable member has been found for the expression. The error occurred for expression "." at position 315 near ".SelectMany(d => d)

Full source code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Z.Expressions;

namespace ConsoleApp7
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string code = """
                          var dictList = new List<Dictionary<string, string>>
                          {
                              new Dictionary<string, string>()
                              {
                                  {"key1", "value1"},
                                  {"key2", "value2"}
                              },
                              new Dictionary<string, string>()
                              {
                                  {"key3", "value3"},
                                  {"key4", "value4"}
                              }
                          };


                          var mergedDict = dictList
                          	.SelectMany(d => d)
                          	.ToDictionary(kv => kv.Key, kv => kv.Value);
                          """;

            try
            {
                Eval.Execute(code);

            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Console.ReadLine();
        }
    }
}
@JonathanMagnan JonathanMagnan self-assigned this May 9, 2024
@JonathanMagnan
Copy link
Member

Hello @cuiliang ,

Thank you for reporting, we will try to reproduce the issue with your information

Best Regards,

Jon

@JonathanMagnan
Copy link
Member

Hello @cuiliang ,

Thank you again for reporting.

My developer is currently able to reproduce the issue. Unfortunately, he is currently requesting some help, and I'm on vacation.

So I will look into this issue when I am back on May 20, so it will take longer to fix or progress.

Best Regards,

Jon

@cuiliang
Copy link
Author

@JonathanMagnan It's okay, I'm not in a hurry, wish you a happy vacation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants