title: AutoMapper: Mapping Tuple to Tuple
body: <p>I'm using AutoMapper in my ASP.NET MVC4 project. I have a problem when mapping 2 class Question and QuestionViewModel. Here my two model classes:</p>
  
  <pre><code>   public class Question
      {
        public int Id { get; set; }
        public string Content { get; set; }
        public Tuple&lt;int, int&gt; GetVoteTuple()
         {
           "some code here"
         }
      }
  
     public class QuestionViewModel
      {
        public int Id { get; set; }
        public string Content { get; set; }
        public Tuple&lt;int, int&gt; VoteTuple { get; set; }
      }
  </code></pre>
  
  <p>Here is my controller code :</p>
  
  <pre><code>   public class QuestionController: Controller 
      {
         public ActionResult Index(int id)
           {
  
              Question question = Dal.getQuestion(id);
              Mapper.CreateMap&lt;Question, QuestionViewModel&gt;()
                  .ForMember(p =&gt; p.VoteTuple,
                  m =&gt; m.MapFrom(
                  s =&gt; s.GetVoteTuple()
              ));
  
              QuestionViewModel questionViewModel =
                          Mapper.Map&lt;Question, QuestionViewModel&gt;(question);
  
              return View(questionViewModel);
  
            }
       }
  </code></pre>
  
  <p>When I run this code the <code>VoteTuple</code> property in <code>QuestionViewModel</code> has null value. How can I map 2 class with Tuple property ? </p>
  
  <p>Thanks.</p>