I use Entity Framework, so almost all my models are in fact the database. However, sometimes I want to pass to the view a simpler object that is not necessary a database model with all the properties.
For example, I have this model :
int ID
string name
string email
string country
string username
string password
When I pass a model to the login view, I only need the username and password. Thus, I thought about creating a simplified model with only username and password.
My questions :
1) What's the best way to standardize this ? Any best practice ? 2) Can I use inheritance to avoid repeating properties like username / password ? 3) Where I put this non-database model ... in wich cs file ? 4) And what about the name of this simplified model ?
Thank you !