UserViewModel

From Solution Explorer, right-click to the /ViewModels/ folder, add a new UserViewModel.cs C# class, and fill it with the following content:

using Newtonsoft.Json;namespace TestMakerFreeWebApp.ViewModels{    [JsonObject(MemberSerialization.OptOut)]    public class UserViewModel    {        #region Constructor        public UserViewModel()        {        }        #endregion        #region Properties        public string UserName { get; set; }        public string Password { get; set; }        public string Email { get; set; }        public string DisplayName { get; set; }        #endregion    }}

The view model is also pretty standard; it just contains the fields that we need to create the new user entity and save it to the database.

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.