Closed antmeehan closed 3 years ago
Hi @antmeehan
This should be fixed in v1.22. Would you mind testing the fix and letting me know it that works for you as expected?
Please also consider supporting MappingGenerator project. Thanks!
Thanks @cezarypiatek for the fast response! I'm very impressed with your DevOps process too.
The fix stops the crash now, but the mapping doesn't occur as I would expect. Eg.
public class Source
{
public string A { get; set; }
}
public class Destination
{
public string A { get; set; }
}
public IEnumerable<Destination> Example(Dictionary<string, Source> source)
{
return source.Values;
}
gets changed to:
public IEnumerable<Destination> Example(Dictionary<string, Source> source)
{
return source.Values.Select(sourceValue => new Destination());
}
But I would expect:
public IEnumerable<Destination> Example(Dictionary<string, Source> source)
{
return source.Values.Select(sourceValue => new Destination()
{
A = sourceValue.A
});
}
HI @antmeehan
Apologies, my mistake. Please check v1.22.1 (should be released shortly)
Mapping Generator Version v1.21.15
Mapping Generator distribution VSExtension
IDE type and version Microsoft Visual Studio Professional 2019 Version 16.8.4 VisualStudio.16.Release/16.8.4+30907.101
Describe the incorrect behavior When invoking the Quick Action menu on a CS0029 C# Cannot implicitly convert type squiggle which is a
Dictionary<T,K>.ValueCollection
the MappingGenerator extension crashes with the following stack trace:Here is some example code to reproduce:
Describe the expected behavior Would expect either no suggestion from MappingGenerator, or even better it can create mapping from the
ValueCollection
.Screenshots![image](https://user-images.githubusercontent.com/9822503/105184632-8884d600-5b6a-11eb-81e0-0a58741926a7.png)