4
In my controller of Login I use the following code to select the user if it exists, but whenever the user type the incorrect name or password, it gives an error, because it does not find the result for the .First
. I need to do a treatment, so when I find no results does not give this error.
var user = db.Usuario.First(u => u.Nome == model.Nome && u.Senha.Equals(model.Senha));