I have an object, let's call it Sprite
which has a Dictionary<string, SpriteMapImageWrapper>
called SpriteImages
. The key is a string, which needs to be 'stored' in the mapped object. This Dictionary needs to be mapped into a flat List<SpriteMapImageInfo>
. All other properties are identical, yet the dictionary key needs to be mapped to SpriteMapImageInfo.Key
. Is this possible using AutoMapper?
public class SpriteMapImageWrapper
{
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
public class SpriteMapImageInfo
{
public string Key { get; set; }
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}