What is difference between Model and ViewModel in asp.net core mvc? [duplicate]
问题 This question already has answers here : What is ViewModel in MVC? (15 answers) Closed 3 years ago . I have a Account class for account models. public class Account { [Key] public Int64 UID { get; set; } [Required] public string ID { get; set; } [Required] public string PassWord { get; set; } [Required] public string UserName { get; set; } } My project is not a code first project and this is a model class for database 'Account'. But I use only two properties in login view, string ID and