Я пытался отобразить от типизированного объекта до dynamic
, но это кажется невозможным.Карта от типизированного объекта до динамического
Например:
public class Customer
{
public string CustomerName {get; set;}
public Category Category {get; set;}
}
public class Category
{
public string CategoryName {get; set;}
public int IgnoreProp {get; set;}
}
Тогда я хотел бы мой результат, как показано ниже:
var customer = new Customer
{
CustomerName = "Ibrahim",
Category = new Category
{
CategoryName = "Human",
IgnoreProp = 10
}
};
dynamic dynamicCustomer = Mapper.Map<Customer, dynamic>(customer);
Могу ли я настроить AutoMapper
, чтобы как-то справиться с этим?