0
I am creating a program and I need the user to register to log in. When running the program, when I try to register this error appears in Visual Studio: "The model backing the 'Banco' context has changed Since the database was created." This error points this part of the code in the first line (User ...):
public bool Login(String login, String senha)
{
Usuario usuario = this.banco.Usuarios.Where(user => user.Email.Equals(login) && user.Senha.Equals(senha)).FirstOrDefault();
Gerenciador.usuarioLogado = usuario;
return (usuario != null);
}
Here is the beginning of the code:
public class Gerenciador
{
public static Usuario usuarioLogado;
private Banco banco = new Banco();
(...)
Please help me. I need to deliver this program this week and I can’t even log into the program :x
Thank you in advance!
It worked, but has now switched to "System.Data.Entity.Core.Entitycommandexecutionexception: 'An error occurred while executing the command Definition. See the Inner Exception for Details. ' " Continued aimed at the same stretch... :s
– Cassiane
Your schema Has the database changed since you last logged in? Both on the C# (EF Code First) and SQL Server sides? If yes, you have to synchronize the change in the part that has not yet been changed.
– Marcelo Shiniti Uchimura
Marcelo, I’m not sure because I have another colleague modifying as well. ?
– Cassiane
If SQL Server has won/lost tables or columns, this should be reflected in Code First and vice versa. This is the synchronization.
– Marcelo Shiniti Uchimura
I get it. I’m gonna look for this
– Cassiane