public static bool Login(string login, string senha)
 {
     using (FinancaContexto entities = new FinancaContexto())
     {
         return(entities.Usuarios.Any(user =>
                                      user.Username.Equals(login, StringComparison.OrdinalIgnoreCase) &&
                                      user.Senha == senha));
     }
 }
Esempio n. 2
0
        public override string[] GetRolesForUser(string username)
        {
            FinancaContexto db   = new FinancaContexto();
            string          data = db.Usuarios.SingleOrDefault(x => x.Username == username)?.Nivel.Nome;

            string[] result = { data };
            return(result);
            //https://www.youtube.com/watch?v=OSYy919rG6E
        }