title: Cast Model to ViewModel
body: <p>this is my Category model :</p>
  
  <pre><code>public class Category :IAggregateRoot
      {
          public Guid Id { get; set; }
          public string Name { get; set; }
  
      }
  </code></pre>
  
  <p>and this is my CategoryViewModel :</p>
  
  <pre><code> public class CategoryViewModel
      {
          public Guid  CategoryId { get; set; }
          public string Name { get; set; }
      }
  </code></pre>
  
  <p>and I wanna to cast this Category to CategoryViewModel with Automapper , if I change the CategoryId in CategoryViewModel to Id , it will be OK! but in this case I don't get the Guid value in my controller ! how can I cast these to Guid to each other ??
   and also this is me mapper class :</p>
  
  <pre><code>public static CategoryViewModel ConvertToCategoryViewModel(this Category category)
          {
              return Mapper.Map&lt;Category, CategoryViewModel&gt;(category);
          }
  </code></pre>