I'm developing my first MVC5 website and it happens this is also the first time I'm using ET.
I'm using Database First approach.
For example, lets say these are my fields in Users table.
| Username | Email | Password |
And Entity Frameworks generate me the following class:
class Users
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
}
Now lets say I want to create a View for Registration. This registration requires user to confirm his password. Do I expand the existing ET generated class like this?
class Users
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
}
Or do I make an entirely different class myself that will contain all the necessary information separately from ET generated class?
Do I make Views using ET generated classes, or do I use my own classes?
I've seen ViewModels being mentioned here and there, but it is not very clear to me as to what purpose they serve.
As of right now, I'm manually adding extra fields to ET classes, and it works, but I've no idea if I'm doing it wrong or right.
RegisterViewModel. Then to compare those properties, useCompareattribute, exactly like what is used in ASP.NET MVC default project template.