Domanda

My DTO class contains another sub class say,

Class ABC_DTO
{
   public String XYZ {get;set;}

   public BCD_DTO BCD {get;set;}
}

Class BCD_DTO 
{
     public string Name {get;set;}
     public string Age  {get;set;}
}


//This is Viewmodel

class PQR_ViewModel
{

    public string Name {get;set;}
    public string Age  {get;set;}
    public String XYZ {get;set;}
}


How can i map above Dto ABC_DTO into PQR_ViewModel using ValueInjecter?  
È stato utile?

Soluzione

var viewModel = new PQR_ViewModel();

viewModel.InjectFrom(abc);
viewModel.InjectFrom(abc.BCD);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top