I have an Enum and I want to make a mapper with dictionary.
This is my Enum:
public enum PrintOrderStatus
{
Pending = 1,
Confirmed = 2,
PreparedForPrint = 3,
PreparedForDevlivery = 4,
Delivered = 5,
Canceled = int.MaxValue,
}
and this is my dictionary:
var map = new Dictionary<PrintOrderStatus, PrintOrderStatus[]>
{
{ PrintOrderStatus.Pending, new[] { PrintOrderStatus.Canceled,
PrintOrderStatus.Confirmed } },
{ PrintOrderStatus.Confirmed, new[] { PrintOrderStatus.PreparedForPrint,
PrintOrderStatus.PreparedForDevlivery } },
{ PrintOrderStatus.PreparedForDevlivery, new[] { PrintOrderStatus.Delivered } },
};
Given the current status of my entity, how can I have the values for different keys in an array?
To get the values associated with a key in a dictionary, you should do: