Таблица компоновщика Automapper - PullRequest
0 голосов
/ 02 марта 2012

Я пытаюсь отобразить две сущности, связанные через таблицу линкеров.

OrganizationVM = Organization - | --- --- | - Адресодин ко многим много к одному

Моя цель - получить ViewModel для организации со свойством State из объекта Address.состояние строки = OrganizationVM.StateКто-нибудь знает, как мне это сделать?

Спасибо!

public class OrganizationVM : BaseViewModel 
{ 
    [Display(Name = "Parent ID")]
    [Required]
    public int? ParentID { get; set; }
    public string ParentInternalName { get; set; } 
    public string State { get; set; }
    public string StateAbr { get; set; }
    public string City { get; set; }
}

public class AddressLinker 
{ 
    public int ID {get; set;}
    public int OrganizationID { get; set; }
    public int AddressID { get; set; } 
}

public class Address 
{ 
    public int ID {get; set;}
    public string State { get; set; }
    public string Code { get; set; }
    public string City { get; set; }
}

public class Organization
{  
    public int ID {get; set;}
    public int? ParentID { get; set; }
    public string ParentInternalName { get; set; } 
    public bool StructuralNode { get; set; } 
    public string InternalName { get; set; } 
    public string ExternalShortName { get; set; } 
    public string ExternalFullName { get; set; } 
    public string State { get; set; }
    public string Code { get; set; }
    public string City { get; set; }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...