У меня есть следующие объекты домена:
public class ComponentType
{
public int ComponentTypeID { get; set; }
public string Component_Type { get; set; }
public string ComponentDesc { get; set; }
}
public class AffiliateComponentType
{
public int AffiliateComponentID { get; set; }
public int AffiliateID { get; set; }
public ComponentType ComponentType { get; set; }
public bool MandatoryComponent { get; set; }
public bool CanBeBookedStandalone { get; set; }
public int PreferenceOrder { get; set; }
}
Я получу СПИСОК AffiliateComponentType из БД, используя NHibernate. Теперь мне нужно заполнить СПИСОК AffiliateComponentTypeView (модель представления) из СПИСКА объекта домена AffiliateComponentType. Как я могу добиться этого с помощью AutoMapper?
[Serializable]
public class AffiliateComponentTypeView
{
public int ComponentTypeID { get; set; }
public string Component_Type { get; set; }
public string ComponentDesc { get; set; }
public bool MandatoryComponent { get; set; }
public bool CanBeBookedStandalone { get; set; }
public int PreferenceOrder { get; set; }
}