Hello guys. I map my objects to dtos with Automapper.
public class OrderItem : BaseDomain
{
public virtual Version Version { get; set; }
public virtual int Quantity { get; set; }
}
[DataContract]
[Serializable]
public class OrderItemDTO
{
[DataMember]
public int Id { get; set; }
[DataMember]
public string Guid { get; set; }
[DataMember]
public virtual int? VersionId { get; set; }
[DataMember]
public virtual string VersionName { get; set; }
[DataMember]
public virtual int Quantity { get; set; }
}
So when I have OrderItem with null version, i get an exception at:
Mapper.Map<OrderItem, OrderItemDTO>(item)
Missing type map configuration or unsupported mapping.