Why Automapper not working for base & inherited classes
<p>In an MVC application, there is a Student class inherited from <code>ApplicationUser</code> base class (ASP.NET Identity) and there is a <code>ViewModel</code> of it called <code>StudentViewModel</code> as shown below:</p>

<p><strong>Entity Classes:</strong></p>

<pre><code>public class ApplicationUser : IdentityUser&lt;int, ApplicationUserLogin,
                                     ApplicationUserRole, ApplicationUserClaim&gt;, IUser&lt;int&gt;
{
    public string Name { get; set; }
    public string Surname { get; set; } 
    //code omitted for brevity
}

public class Student: ApplicationUser
{     
    public int? Number { get; set; }
}
</code></pre>

<p><strong>ViewModel:</strong></p>

<pre><code>public class StudentViewModel
{
    public int Id { get; set; }     
    public int? Number { get; set; }
    //code omitted for brevity
}
</code></pre>

<p>I use the following method in order to update a Student by mapping <code>StudentViewModel</code> to <code>ApplicationUser</code> in the Controller:</p>

<pre><code>[HttpPost]
[ValidateAntiForgeryToken]
public JsonResult Update([Bind(Exclude = null)] StudentViewModel model)
{
    //Mapping StudentViewModel to ApplicationUser ::::::::::::::::
    var student = (Object)null;

    Mapper.Initialize(cfg =&gt;
    {
        cfg.CreateMap&lt;StudentViewModel, Student&gt;()
            .ForMember(dest =&gt; dest.Id, opt =&gt; opt.Ignore())
            .ForAllOtherMembers(opts =&gt; opts.Ignore());
    });

    Mapper.AssertConfigurationIsValid();
    student = Mapper.Map&lt;Student&gt;(model);
    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    //Then I want to pass the mapped property to the UserManager's Update method:
    var result = UserManager.Update(student);

    //code omitted for brevity              
}
</code></pre>

<p>When using this method, I encounter an error: </p>

<blockquote>
  <p>The type arguments for method 'UserManagerExtensions.Update(UserManager, TUser)' cannot be inferred from the usage. Try specifying the type arguments explicitly.</p>
</blockquote>

<p>Any idea to fix it? </p>