I have a **.net core 2** code with a simple UI.   

I Want to pass data from my form to action method in my controller which accepts a **ViewModel parameter ( I Have To Use View Model )** But when I submit my form, I get **null** as a result. When I Use **User** as a Parameter type, everything is ok. this is my Code.   

**My Model**

```
 public class User
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string LastName { get; set; }
        public int Age { get; set; }
    }

```

**My View Model**

```
public class UsersViewModel
    {
        public User NewUser { get; set; }
    }

```

**My Action**

```
[HttpPost]
public IActionResult Index(UsersViewModel user)
  {
      UserDbContext context = new UserDbContext();
      context.Users.Add(user);
      context.SaveChanges();
      return View();
  }

```

**And My View**

```
@model EFCore2.ViewModels.UsersViewModel

<form asp-controller="Home" asp-action="index" method="post">
    <input name="Name" />
    <input name="LastName" />
    <input name="Age" />
    <br />
    <input type="submit" value="Ok" />
</form>

```

Help Me Please :(