Skip to content

Incorrect dictionary mapping #3

@DeagleGross

Description

@DeagleGross

Describe the bug
Incorrect dictionary mapping

To Reproduce
Steps to reproduce the behavior:

  • mapping internal model with
public Dictionary<long, Version> Versions { get; set; }

public class Version
{
    public long Id { get; set; }        
    public string Name { get; set; }
}
  • getting such a result
Versions = new Dictionary()
{
    Comparer = request.Versions.Comparer,
    Count = request.Versions.Count,
    Item = request.Versions.Item,
    Keys = request.Versions.Keys,
    Values = request.Versions.Values
}

Expected behavior
Dictionary should map correctly:

Versions = request.Versions.ToDictionary(pair => pair.Key, pair => new UserResponse.Version
{
    Id = pair.Value.Id,
    Name = pair.Value.Name
})

Screenshots
This is how it is working now:
image

Desktop:

  • Rider version 2021.2, 212.4746.114

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions