public void CriarUsuario(Login login) { EnglishGo_Context db = new EnglishGo_Context(); db.Login.Add(login); db.SaveChanges(); }
public bool Validar(ref Login login) { using (EnglishGo_Context db = new EnglishGo_Context()) { string user = login.User; string password = login.Password; var contas = db.Login.Where(log => log.User == user && log.Password == password); if (contas.Count() > 0) { login = contas.First(); return true; } else return false; } }